Q. Write an assembly function which hides the cursor?
Write an assembly function which hides the cursor. Call it from a C program.
. PUBLIC CUROFF
. MODEL small, C
. CODE
CUROFF PROC
MOV AH, 3 ; get the current cursor position
XOR BX, BX ; empty BX register
INT 10h ; use int 10hto do above
OR CH, 20h ; force to OFF condition
MOV AH, 01 ; set the new cursor values
INT 10h
RET
CUROFF ENDP
END
The C program to test this routine is as follows:
# include < stdio.h
void curoff(void);
void main()
{
printf("%s\n, "The cursor is now turning off);
curoff();
}
You can write another procedure in assembly language program to put cursor on. This can be done by replacing OR CH, 20h instruction by AND CH, 1Fh. You can call this new function from C program to put cursor on after curoff.