i have started to write a program that asks the user to enter a number to change the colour of the text and then again for the background.
however i am stuck on how to use C with ASM.
here is the code i have so far.
Code:
#include <stdio.h>
#include <conio.h>
void ClearScreen(void);
void BGcolour(void);
void main()
{
ClearScreen();
BGcolour();
}
void BGcolour()
{
int number;
printf ("Please enter a number");
scanf ("%d", number);
asm{mov ah,02
mov bh,0 //sets where the writing is. bigger the number the more it shifts accross the screen.
mov dx,0
int 10h
mov ah,9
mov cx,2000
mov bl,4eh//first number is background colour, second is text colour
mov al,' '
int 10h
}
printf ("Hello this is the new text colour");
}
void ClearScreen(void)
{
asm{mov ah,6
mov al,0
mov bh,1
mov ch,0
mov cl,0
mov dh,24
mov dl,79
int 10h
}
}
sorry if this is in the wrong section
can anyone help?