From 113bae7311b63e55e55160970718d19bfeeb56c3 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 1 Jan 2020 17:23:29 -0800 Subject: 5856 --- html/apps/ex2.subx.html | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 html/apps/ex2.subx.html (limited to 'html/apps/ex2.subx.html') diff --git a/html/apps/ex2.subx.html b/html/apps/ex2.subx.html new file mode 100644 index 00000000..c67315e9 --- /dev/null +++ b/html/apps/ex2.subx.html @@ -0,0 +1,79 @@ + + + + +Mu - examples/ex2.subx + + + + + + + + + + +https://github.com/akkartik/mu/blob/master/examples/ex2.subx +
+ 1 # Add 1 and 1, and return the result in the exit code.
+ 2 #
+ 3 # To run:
+ 4 #   $ ./subx translate init.linux examples/ex2.subx -o examples/ex2
+ 5 #   $ ./subx run examples/ex2
+ 6 # Expected result:
+ 7 #   $ echo $?
+ 8 #   2
+ 9 
+10 == code
+11 
+12 Entry:
+13 # ebx = 1
+14 bb/copy-to-ebx  1/imm32
+15 # increment ebx
+16 43/increment-ebx
+17 # exit(ebx)
+18 e8/call  syscall_exit/disp32
+19 
+20 # . . vim:nowrap:textwidth=0
+
+ + + -- cgit 1.4.1-2-gfad0