diff --git a/subx/Readme.md b/subx/Readme.md index 8ed47deb..cdfb1f06 100644 --- a/subx/Readme.md +++ b/subx/Readme.md @@ -49,6 +49,21 @@ Running `subx` will transparently compile it as necessary. translate`. Useful for debugging, and also enables more thorough testing of `translate`. +Putting them together, build and run one of the example programs: + +ex1.1.subx + +``` +$ ./subx translate ex1.1.subx ex1 +$ ./subx run ex1 +``` + +If you're running on Linux, `ex1` will also be runnable directly: +``` +$ chmod +x ex1 +$ ./ex1 +``` + I'm not building general infrastructure here for all of the x86 ISA and ELF format. SubX is about programming with a small, regular subset of 32-bit x86: diff --git a/subx/ex1.1.subx b/subx/ex1.1.subx index 6b601926..220af79e 100644 --- a/subx/ex1.1.subx +++ b/subx/ex1.1.subx @@ -1,4 +1,5 @@ ## first program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html +# Just return 42. # # To run: # $ subx translate ex1.1.subx ex1 diff --git a/subx/ex1.2.subx b/subx/ex1.2.subx index 03b7ea9c..81f2bfe2 100644 --- a/subx/ex1.2.subx +++ b/subx/ex1.2.subx @@ -1,4 +1,5 @@ ## first program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html +# Just return 42. # # To run: # $ subx translate ex1.2.subx ex1 diff --git a/subx/html/ex1.png b/subx/html/ex1.png new file mode 100644 index 00000000..c491c471 Binary files /dev/null and b/subx/html/ex1.png differ