2018-12-01 00:45:15 +00:00
|
|
|
# First program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
|
2018-07-16 14:55:07 +00:00
|
|
|
# Just return 42.
|
2018-07-01 07:01:13 +00:00
|
|
|
#
|
2019-08-20 06:45:04 +00:00
|
|
|
# To run:
|
2018-12-30 08:36:07 +00:00
|
|
|
# $ ./subx translate examples/ex1.2.subx -o examples/ex1
|
|
|
|
# $ ./subx run examples/ex1
|
2018-07-27 23:53:47 +00:00
|
|
|
# Expected result:
|
|
|
|
# $ echo $?
|
|
|
|
# 42
|
2018-07-01 07:01:13 +00:00
|
|
|
|
2019-05-18 07:00:18 +00:00
|
|
|
== code 0x09000000
|
2018-11-26 08:26:20 +00:00
|
|
|
|
2019-07-15 19:26:41 +00:00
|
|
|
Entry:
|
2018-12-01 00:45:15 +00:00
|
|
|
# syscall(exit, 42)
|
2019-08-26 18:55:26 +00:00
|
|
|
bb/copy-to-ebx 2a/imm32 # 42 in hex
|
|
|
|
b8/copy-to-eax 1/imm32/exit
|
2018-10-06 04:50:20 +00:00
|
|
|
cd/syscall 0x80/imm8
|
2018-07-01 07:01:13 +00:00
|
|
|
|
2019-07-15 19:26:41 +00:00
|
|
|
== data 0x0a000000
|
|
|
|
|
2018-11-30 19:10:44 +00:00
|
|
|
# . . vim:nowrap:textwidth=0
|