about summary refs log tree commit diff stats
path: root/bochsrc.2disks
diff options
context:
space:
mode:
Diffstat (limited to 'bochsrc.2disks')
-rw-r--r--bochsrc.2disks16
1 files changed, 16 insertions, 0 deletions
diff --git a/bochsrc.2disks b/bochsrc.2disks
new file mode 100644
index 00000000..c3e99ba9
--- /dev/null
+++ b/bochsrc.2disks
@@ -0,0 +1,16 @@
+# Configuration for the Bochs x86 CPU emulator to run baremetal Mu programs
+# See boot.subx for more details.
+#
+# Installing Bochs:
+#   On Mac OS:
+#     brew install bochs
+#   On Ubuntu Linux 20.04:
+#     sudo apt install bochs bochs-sdl bochsbios vgabios
+
+display_library: sdl2
+
+ata0-master: type=disk, path="disk.img", mode=flat, cylinders=20, heads=16, spt=63  # 10MB, 512 bytes per sector
+ata0-slave: type=disk, path="data.img", mode=flat, cylinders=20, heads=16, spt=63  # 10MB, 512 bytes per sector
+boot: disk
+mouse: enabled=1, toggle=ctrl+f10
+log: -
n' href='/akkartik/mu/blame/examples/ex2.subx?h=hlt&id=4d53de8afa0d44e29d3caeb01ccdd02bc2e4cd70'>^
e5cbbea4 ^
294a1520 ^
9a524793 ^



ecfbbfb5 ^

294a1520 ^
ee9a9237 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
                                                      
 
         

                                                                


                  
 
       
 
      



                                              

                            
 
                            
# Add 3 and 4, and return the result in the exit code.
#
# To run:
#   $ ./bootstrap translate init.linux apps/ex2.subx -o apps/ex2
#   $ ./bootstrap run apps/ex2
# Expected result:
#   $ echo $?
#   2

== code

Entry:
# ebx = 3
bb/copy-to-ebx  3/imm32
# add 4 to ebx
81 0/subop/add 3/mod/direct 3/rm32/ebx 4/imm32
# exit(ebx)
e8/call  syscall_exit/disp32

# . . vim:nowrap:textwidth=0