From 6e1eeeebfb453fa7c871869c19375ce60fbd7413 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 27 Jul 2019 16:01:55 -0700 Subject: 5485 - promote SubX to top-level --- html/examples/ex1.subx.html | 80 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 html/examples/ex1.subx.html (limited to 'html/examples/ex1.subx.html') diff --git a/html/examples/ex1.subx.html b/html/examples/ex1.subx.html new file mode 100644 index 00000000..9a203cdc --- /dev/null +++ b/html/examples/ex1.subx.html @@ -0,0 +1,80 @@ + + + + +Mu - subx/examples/ex1.subx + + + + + + + + + + +https://github.com/akkartik/mu/blob/master/subx/examples/ex1.subx +
+ 1 # First program: same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
+ 2 # Just return 42.
+ 3 #
+ 4 # To run (from the subx directory):
+ 5 #   $ ./subx translate examples/ex1.2.subx -o examples/ex1
+ 6 #   $ ./subx run examples/ex1
+ 7 # Expected result:
+ 8 #   $ echo $?
+ 9 #   42
+10 
+11 == code 0x09000000
+12 
+13 Entry:
+14 # syscall(exit, 42)
+15 bb/copy-to-EBX  2a/imm32  # 42 in hex
+16 b8/copy-to-EAX  1/imm32/exit
+17 cd/syscall  0x80/imm8
+18 
+19 == data 0x0a000000
+20 
+21 # . . vim:nowrap:textwidth=0
+
+ + + -- cgit 1.4.1-2-gfad0