From 5a2cb154eb016aa8b84ad939f63eb56dd7a0a90f Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 2 Oct 2018 01:21:01 -0700 Subject: 4649 --- html/subx/examples/ex1.subx.html | 79 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 html/subx/examples/ex1.subx.html (limited to 'html/subx/examples/ex1.subx.html') diff --git a/html/subx/examples/ex1.subx.html b/html/subx/examples/ex1.subx.html new file mode 100644 index 00000000..4ed9359e --- /dev/null +++ b/html/subx/examples/ex1.subx.html @@ -0,0 +1,79 @@ + + + + +Mu - 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
+12 # instruction                     effective address                                                   operand     displacement    immediate
+13 # op          subop               mod             rm32          base        index         scale       r32
+14 # 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes
+15   bb/copy                                                                                                                         2a/imm32          # copy 42 to EBX
+16   # exit(EBX)
+17   b8/copy                                                                                                                         1/imm32           # copy to EAX
+18   cd/syscall  0x80/imm8
+19 
+20 # vim:ft=subx
+
+ + + -- cgit 1.4.1-2-gfad0