home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
CEXPRESS.ZIP
/
SCREEN.ASM
/
SETCOLOR.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-05-03
|
951b
|
38 lines
;void set_color(col,row,color);
; unsigned char col,row,color;
EXTRN _memory_model:byte
EXTRN _video_page:byte
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT
PUBLIC _set_color
_set_color proc near
push bp ;save BP
mov bp,sp ;set stack frame
cmp _memory_model,0 ;near or far?
jle begin ;jump if near
inc bp ;else add 2 to BP
inc bp ;
begin: mov bh,_video_page ;set the page
mov dh,[bp+6] ;row to DH
dec dh ;count from 0
mov dl,[bp+4] ;col to DL
dec dl ;count from 0
mov ah,2 ;function to set cursor
int 10h ;set the cursor
mov ah,8 ;func to read attribute
int 10h ;char now in AL
mov ah,9 ;function to write char
mov cx,1 ;write at 1 pos only
mov bl,[bp+8] ;new attribute
int 10h ;set the new attribute
pop bp ;restore BP
cmp _memory_model,0 ;quit
jle quit ;
db 0CBh ;RET far
quit: ret ;RET near
_set_color endp
_TEXT ENDS
END