home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
CEXPRESS.ZIP
/
GRAPHIC.ASM
/
CHARBOXB.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-05-03
|
1KB
|
55 lines
;void char_box_b(ch,,col,row,width,depth,color);
; unsigned char ch,col,row,width,depth,color;
EXTRN _memory_model:byte
EXTRN _video_page:byte
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT
PUBLIC _char_box_b
_char_box_b proc near
push bp ;
mov bp,sp ;set stack frame
push di ;
push si ;
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 number
mov al,[bp+4] ;character to AL
mov ah,9 ;function to write char
mov di,ax ;copy in DI
mov bl,[bp+14] ;attribute in BL
mov dl,[bp+6] ;column in DL
dec dl ;count from 0
mov dh,[bp+8] ;row in DH
dec dh ;count from 0
sub cx,cx ;
mov cl,[bp+12] ;depth in si
mov si,cx ;
dec si ;dec for range test
inc si ;undo adjustment
sub cx,cx ;
mov cl,[bp+10] ;width in CX
dec cx ;dec for range test
inc cx ;undo adjustment
L1: mov ah,2 ;function to set cursor
int 10h ;set the cursor
mov ax,di ;function num and char
int 10h ;write CX chars
inc dh ;forward row count
dec si ;dec row counter
jnz L1 ;go write next row
L2: pop si ;
pop di ;
pop bp ;
cmp _memory_model,0 ;quit
jle quit ;
db 0CBh ;RET far
quit: ret ;RET near
_char_box_b endp
_TEXT ENDS
END