From ee0e67b9d7c275480827d856b926d2c403057bb8 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 6 Mar 2020 18:39:16 -0800 Subject: 6091 --- html/apps/ex13.subx.html | 87 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 html/apps/ex13.subx.html (limited to 'html/apps/ex13.subx.html') diff --git a/html/apps/ex13.subx.html b/html/apps/ex13.subx.html new file mode 100644 index 00000000..d85c5166 --- /dev/null +++ b/html/apps/ex13.subx.html @@ -0,0 +1,87 @@ + + + + +Mu - apps/ex13.subx + + + + + + + + + + +https://github.com/akkartik/mu/blob/master/apps/ex13.subx +
+ 1 # Compare 3 and 3.
+ 2 #
+ 3 # To run:
+ 4 #   $ ./bootstrap translate init.linux apps/ex13.subx -o apps/ex13
+ 5 #   $ ./bootstrap run apps/ex13
+ 6 # Expected result:
+ 7 #   $ echo $?
+ 8 #   1
+ 9 
+10 == code
+11 #   instruction                     effective address                                                   register    displacement    immediate
+12 # . op          subop               mod             rm32          base        index         scale       r32
+13 # . 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
+14 
+15 Entry:
+16     b8/copy-to-eax  3/imm32
+17     3d/compare-eax-and  3/imm32
+18     0f 94/set-if-=                  3/mod/direct    3/rm32/ebx    .           .             .           .           .               .                 # set ebx to ZF
+19     81 4/subop/and                  3/mod/direct    3/rm32/ebx    .           .             .           .           .               0xff/imm32        # AND eax with 0xff
+20 
+21 $exit:
+22     # exit(ebx)
+23     e8/call  syscall_exit/disp32
+24 
+25 # . . vim:nowrap:textwidth=0
+
+ + + -- cgit 1.4.1-2-gfad0