mu/linux/ex1.subx

19 lines
371 B
Plaintext
Raw Normal View History

# First program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
2018-07-16 14:55:07 +00:00
# Just return 42.
#
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
== code
2018-11-26 08:26:20 +00:00
Entry:
# exit(42)
2020-01-02 22:12:46 +00:00
bb/copy-to-ebx 0x2a/imm32 # 42 in hex
e8/call syscall_exit/disp32
# . . vim:nowrap:textwidth=0