Skip to content

Instantly share code, notes, and snippets.

@foxiepaws
Created May 6, 2019 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foxiepaws/022f83cf9cb4fdc2675725054192c511 to your computer and use it in GitHub Desktop.
Save foxiepaws/022f83cf9cb4fdc2675725054192c511 to your computer and use it in GitHub Desktop.
; 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