Skip to content

Instantly share code, notes, and snippets.

@Trinitek
Created January 2, 2015 18:13
Show Gist options
  • Save Trinitek/eefb6faebdba4dbf63f7 to your computer and use it in GitHub Desktop.
Save Trinitek/eefb6faebdba4dbf63f7 to your computer and use it in GitHub Desktop.
16-bit line drawing (works!)
asm("mov ax, [bp - 4] \n" // ax = (dy)
"mov bx, [bp - 6] \n"); // bx = (newX)
asm("imul bx \n"); // dx:ax = (dy * newX)
asm("idiv word [bp - 2] \n"); // ax = dx:ax / (dx)
asm("mov [bp - 8] , ax \n"); // (newY) = ax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment