home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
CEXPRESS.ZIP
/
SCREEN.ASM
/
CURSLEFT.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-05-03
|
827b
|
34 lines
;void cursor_left(columns);
; unsigned short columns;
EXTRN _memory_model:byte
EXTRN _video_page:byte
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT
PUBLIC _cursor_left
_cursor_left 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 ;get page number
mov ah,3 ;func to get cursor pos
int 10h ;ROW in DH, COL in DL
mov ah,2 ;func to set cursor
sub dl,[bp+4] ;subtract offset
cmp dl,79 ;in range?
jna L1 ;jump ahead if so
mov dl,0 ;else left column
L1: int 10H ;reset cursor
pop bp ;restore BP
cmp _memory_model,0 ;quit
jle quit ;
db 0CBh ;RET far
quit: ret ;RET near
_cursor_left endp
_TEXT ENDS
END