about summary refs log blame commit diff stats
path: root/baremetal/ex1.subx
blob: 196b4104eac148b67e32215dd8d1677110ae0bf3 (plain) (tree)






















                                                                                
# The simplest possible program: just an infinite loop.
# All is well if your computer clears screen and hangs without restarting.
# On an emulator the window may get bigger to accomodate the higher-resolution
# graphics mode.
#
# To convert to a disk image, first prepare a realistically sized disk image:
#   dd if=/dev/zero of=disk.img count=20160          # 512-byte sectors, so 10MB
# Load the program on the disk image:
#   ./translate_subx_baremetal baremetal/ex1.subx    # emits a.bin
#   apps/hex < baremetal/boot.hex  > boot.bin
#   cat boot.bin a.bin > disk.bin
#   dd if=disk.bin of=disk.img conv=notrunc
# To run:
#   qemu-system-i386 disk.img
# Or:
#   bochs -f baremetal/boot.bochsrc  # boot.bochsrc loads disk.img

== code

$loop:
e9/jump $loop/disp32

# vim:ft=subx