Created
May 6, 2019 05:46
-
-
Save foxiepaws/022f83cf9cb4fdc2675725054192c511 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; functions | |
gfxmode: | |
xor ax,ax | |
mov al,0x13 | |
int 0x10 | |
ret | |
keypress: | |
mov ah,0x00 | |
int 0x16 | |
ret | |
reboot: | |
jmp long 0xffff:0x0000 | |
putpix: | |
mov cx,320 | |
mul cx ; multiply ax (Y) by 320 | |
add ax,bx ; add bx (X) to ax (Y) | |
mov di,ax ; pixel position is now in di | |
mov byte [es:di], dl ; move dl (colour) to video memory | |
ret | |
start: | |
call gfxmode | |
mov ax,0xa000 | |
mov es,ax ; vga register to es | |
mov ax,50 | |
mov bx,50 | |
mov dl,0x0f ; white | |
call putpix | |
call keypress | |
call reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment