mu/linux/ex2.subx

21 lines
376 B
Plaintext
Raw Normal View History

2020-07-05 22:28:37 +00:00
# Add 3 and 4, and return the result in the exit code.
2018-07-24 18:53:45 +00:00
#
2019-08-20 06:45:04 +00:00
# To run:
2021-03-30 01:47:52 +00:00
# $ bootstrap/bootstrap translate ex2.subx -o ex2
2021-03-04 08:24:24 +00:00
# $ bootstrap/bootstrap run ex2
# Expected result:
# $ echo $?
# 2
== code
2018-11-26 08:26:20 +00:00
Entry:
2020-07-05 22:28:37 +00:00
# ebx = 3
bb/copy-to-ebx 3/imm32
# add 4 to ebx
81 0/subop/add 3/mod/direct 3/rm32/ebx 4/imm32
# exit(ebx)
e8/call syscall_exit/disp32
# . . vim:nowrap:textwidth=0