Skip to content

Instantly share code, notes, and snippets.

@root42
Created April 5, 2020 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save root42/95aa982c24647ecb381aa0274d2c5a59 to your computer and use it in GitHub Desktop.
Save root42/95aa982c24647ecb381aa0274d2c5a59 to your computer and use it in GitHub Desktop.
Using Turbo C with Inline Assembly
#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