1 # Test out the video mode by filling in the screen with pixels. 2 # 3 # To build a disk image: 4 # ./translate ex2.mu # emits code.img 5 # To run: 6 # qemu-system-i386 code.img 7 # Or: 8 # bochs -f bochsrc # bochsrc loads code.img 9 10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { 11 var y/eax: int <- copy 0 12 { 13 compare y, 0x300/screen-height=768 14 break-if->= 15 var x/edx: int <- copy 0 16 { 17 compare x, 0x400/screen-width=1024 18 break-if->= 19 var color/ecx: int <- copy x 20 color <- and 0xff 21 pixel-on-real-screen x, y, color 22 x <- increment 23 loop 24 } 25 y <- increment 26 loop 27 } 28 }