2018-12-01 00:45:15 +00:00
|
|
|
# Add 1 and 1, 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:
|
2020-03-07 02:07:39 +00:00
|
|
|
# $ ./bootstrap translate init.linux apps/ex2.subx -o apps/ex2
|
|
|
|
# $ ./bootstrap run apps/ex2
|
2018-07-25 03:39:59 +00:00
|
|
|
# Expected result:
|
|
|
|
# $ echo $?
|
|
|
|
# 2
|
2018-07-07 06:34:10 +00:00
|
|
|
|
2019-09-12 02:04:49 +00:00
|
|
|
== code
|
2018-11-26 08:26:20 +00:00
|
|
|
|
2019-07-17 07:47:11 +00:00
|
|
|
Entry:
|
2019-08-26 18:55:26 +00:00
|
|
|
# ebx = 1
|
|
|
|
bb/copy-to-ebx 1/imm32
|
|
|
|
# increment ebx
|
|
|
|
43/increment-ebx
|
2019-09-12 02:04:49 +00:00
|
|
|
# exit(ebx)
|
|
|
|
e8/call syscall_exit/disp32
|
2019-07-17 07:47:11 +00:00
|
|
|
|
2018-11-30 19:10:44 +00:00
|
|
|
# . . vim:nowrap:textwidth=0
|