From 78357b8852626b510527f3b8d770a7dd8956fcc7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 16 Jul 2021 08:38:43 -0700 Subject: . --- html/linux/apps/ex1.subx.html | 79 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 html/linux/apps/ex1.subx.html (limited to 'html/linux/apps/ex1.subx.html') diff --git a/html/linux/apps/ex1.subx.html b/html/linux/apps/ex1.subx.html new file mode 100644 index 00000000..678f74c9 --- /dev/null +++ b/html/linux/apps/ex1.subx.html @@ -0,0 +1,79 @@ + + + + +Mu - linux/apps/ex1.subx + + + + + + + + + + +https://github.com/akkartik/mu/blob/main/linux/apps/ex1.subx +
+ 1 # First example: return the answer to the Ultimate Question of Life, the
+ 2 # Universe, and Everything.
+ 3 #
+ 4 # Same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
+ 5 #
+ 6 # To run:
+ 7 #   $ bootstrap/bootstrap translate apps/ex1.subx -o ex1
+ 8 #   $ bootstrap/bootstrap run ex1
+ 9 # Expected result:
+10 #   $ echo $?
+11 #   42
+12 
+13 == code
+14 
+15 Entry:
+16 # exit(42)
+17 bb/copy-to-ebx  0x2a/imm32  # 42 in hex
+18 e8/call  syscall_exit/disp32
+19 
+20 # . . vim:nowrap:textwidth=0
+
+ + + -- cgit 1.4.1-2-gfad0