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:
|
2021-03-30 01:47:52 +00:00
|
|
|
# $ bootstrap/bootstrap translate ex1.subx -o ex1
|
2021-03-04 08:24:24 +00:00
|
|
|
# $ bootstrap/bootstrap run ex1
|
2018-07-27 23:53:47 +00:00
|
|
|
# Expected result:
|
|
|
|
# $ echo $?
|
|
|
|
# 42
|
2018-07-01 07:01:13 +00:00
|
|
|
|
2019-09-12 02:04:49 +00:00
|
|
|
== code
|
2018-11-26 08:26:20 +00:00
|
|
|
|
2019-07-15 19:26:41 +00:00
|
|
|
Entry:
|
2019-09-12 02:04:49 +00:00
|
|
|
# exit(42)
|
2020-01-02 22:12:46 +00:00
|
|
|
bb/copy-to-ebx 0x2a/imm32 # 42 in hex
|
2019-09-12 02:04:49 +00:00
|
|
|
e8/call syscall_exit/disp32
|
2019-07-15 19:26:41 +00:00
|
|
|
|
2018-11-30 19:10:44 +00:00
|
|
|
# . . vim:nowrap:textwidth=0
|