; mcgatest.asm: ; Some buggy code... ; It's supposed to be like an Etch-a-Sketch. ; Can't handle boundaries in a sensible manner, though. ; Just learning int 10h and playing around... ; assemble using: ; nasm mcgatest.asm -fbin -o mcgatest.com org 100h section .text start: ; Enter MCGA mode mov ax, 13h int 10h ; Draw pixel at (x, y) mov ax, 0a000h mov es, ax mov cx, 0 ; y value mov dx, 0 ; x value repaint: call putpixel ; Wait for key press mov ah, 0h int 16h ; if up key: cmp ah, 48h jne notup dec cx jmp repaint notup: ; if left key: cmp ah, 4bh jne notleft dec dx jmp repaint notleft: ; if right key: cmp ah, 4dh jne notright inc dx jmp repaint notright: ; if down key: cmp ah, 50h jne notdown inc cx jmp repaint notdown: ; else return to text mode mov ax, 3 int 10h ; Exit to DOS mov ah, 4ch int 21h putpixel: mov bx, cx mov di, bx xchg bh, bl shl di, 6 add di, bx mov ax, dx add di, ax mov [es:di], byte 3 ret section .data x: dw 1 y: dw 1 c: db 1 section .bss