FF> I don't have an answer to your question, but a question in return.. I
FF> know almost nothing about assembler, but would like to know how to put a
FF> character on the screen with ASM. I reckon that would be a lot faster
FF> than the TextColor; GotoXY; Write; sequence i'm using now... Since it
FF> looks like this is just what you're doing, could you give me the asm
FF> code that i can put into my pascal program?
You can output a character to the screen, controlling the background and
foreground colors with int 10h, funtion 9. Example:
mov ah,9
mov al,'A'
mov bh,0 ;text page number, usually 0
mov bl,0eh ;bg and fg color attributes
mov cx,1 ;print character just once
int 10h
The background and foreground colors are coded as hex digits, and
16*bg+fg is the number inserted into dl. The code above will
output a yellow A on a black background at the cursor position,
but will not advance the cursor. To do that you need more code:
mov ah,3 ;read cursor
mov bh,0 ;
int 10h ;cursor position returned in dx: row,col = dh,dl
mov ah,2 ;
inc dl ;
int 10h ;positions the cursor at row,col = dh,dl
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 530-893-8079 * (1:119/88)
|