Created
January 2, 2015 18:13
-
-
Save Trinitek/eefb6faebdba4dbf63f7 to your computer and use it in GitHub Desktop.
16-bit line drawing (works!)
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
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