Created
April 5, 2020 20:40
-
-
Save root42/95aa982c24647ecb381aa0274d2c5a59 to your computer and use it in GitHub Desktop.
Using Turbo C with Inline Assembly
This file contains hidden or 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
#include <conio.h> | |
#include <stdio.h> | |
int main() | |
{ | |
unsigned char i; | |
int j; | |
asm mov ah, 0x00; | |
asm mov al, 0x13; | |
asm int 0x10; | |
asm push ds; | |
asm mov dx,0xa000; | |
asm mov ds,dx; | |
asm xor dx,dx; | |
for(i=0;i<200;i++) { | |
asm mov ax,dx; | |
for(j=0;j<160;j++) { | |
asm mov bx,ax; | |
asm mov cl, i; | |
asm mov ch, i; | |
asm mov word ptr [bx], cx; | |
asm inc ax; | |
asm inc ax; | |
} | |
asm add dx,320; | |
} | |
asm pop ds; | |
getch(); | |
asm mov ah, 0x00; | |
asm mov al, 0x03; | |
asm int 0x10; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment