home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
CEXPRESS.ZIP
/
SCREEN.ASM
/
GETCOLOR.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-05-03
|
877b
|
36 lines
;unsigned char get_color(col,row);
; unsigned char col,row;
EXTRN _memory_model:byte
EXTRN _video_page:byte
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT
PUBLIC _get_color
_get_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 ;color now in AH
mov al,ah ;color to AL
sub ah,ah ;clear high byte
pop bp ;restore BP and quit
cmp _memory_model,0 ;quit
jle quit ;
db 0CBh ;RET far
quit: ret ;RET near
_get_color endp
_TEXT ENDS
END