This commit is contained in:
Kartik Agaram 2019-07-26 12:16:02 -07:00
parent e355c69310
commit 16fa6d17a9
1 changed files with 14 additions and 6 deletions

View File

@ -77,15 +77,23 @@ You can use SubX to translate itself. For example, running natively on Linux:
$ ./a.elf
$ echo $?
42
# or, automating the above steps
$ ./ntranslate ex1.subx
$ chmod +x a.elf
$ ./a.elf
$ echo $?
42
```
This is just a demonstration; in practice you would use the `ntranslate`
script. For running emulated on other platforms, use the `translate` script.
You'll need 16GB RAM for translating some of the larger programs in emulated
mode. Requirements for native translation are, of course, minimal.
Or, running in a VM on other platforms:
To my knowledge the original C++ and new self-hosted translators always
generate identical binaries. Please [report bugs](mailto:mu@akkartik.com)!
```
$ ./translate ex1.subx # generates identical a.elf to above
$ ./subx run a.elf
$ echo $?
42
```
You can use it to learn about the x86 processor that (almost certainly) runs
your computer. (See below.)