1 # Test out the video mode by filling in the screen with pixels. 2 # 3 # To build a disk image: 4 # ./translate_subx boot.subx ex2.subx # emits disk.img 5 # To run: 6 # qemu-system-i386 disk.img 7 # Or: 8 # bochs -f bochsrc # bochsrc loads disk.img 9 10 == code 11 12 Entry: 13 # ecx <- start of video memory 14 8b/-> *Video-memory-addr 1/r32/ecx 15 16 # eax <- final pixel of video memory 17 8d/copy-address *(ecx + 0x0bffff) 0/r32/eax # 0xbffff = 1024*768 - 1 18 19 # for each pixel in video memory 20 { 21 39/compare %eax 1/r32/ecx 22 7c/jump-if-< break/disp8 23 # write its column number to it 24 88/byte<- *eax 0/r32/AL 25 48/decrement-eax 26 eb/jump loop/disp8 27 } 28 29 # hang indefinitely 30 { 31 eb/jump loop/disp8 32 }