blob: 0406dbe885c90cc81f74d66019ed59e094e86635 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# First example: return the answer to the Ultimate Question of Life, the
# Universe, and Everything.
#
# Same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
#
# To run:
# $ bootstrap/bootstrap translate apps/ex1.subx -o ex1
# $ bootstrap/bootstrap run ex1
# Expected result:
# $ echo $?
# 42
== code
Entry:
# exit(42)
bb/copy-to-ebx 0x2a/imm32 # 42 in hex
e8/call syscall_exit/disp32
# . . vim:nowrap:textwidth=0
|