1 # First program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html 2 # Just return 42. 3 # 4 # To run: 5 # $ ./subx translate examples/ex1.2.subx -o examples/ex1 6 # $ ./subx run examples/ex1 7 # Expected result: 8 # $ echo $? 9 # 42 10 11 == code 0x09000000 12 13 Entry: 14 # syscall(exit, 42) 15 bb/copy-to-ebx 2a/imm32 # 42 in hex 16 b8/copy-to-eax 1/imm32/exit 17 cd/syscall 0x80/imm8 18 19 == data 0x0a000000 20 21 # . . vim:nowrap:textwidth=0