home *** CD-ROM | disk | FTP | other *** search
- ;
- ; VFOS_IBM VFOSSIL driver by Bob Hartman.
- ; Copyright 1988 by Spark Software. ALL RIGHTS RESERVED.
- ;
-
- Enter_Vio macro
-
- push bp
- mov bp,sp
- push bx
- push cx
- push dx
- push si
- push di
- push ds
- push es
-
- push cs
- pop ds
-
- endm
-
- Exit_Vio macro functype,numret
-
- f&functype&_out:
- pop es
- pop ds
- pop di
- pop si
- pop dx
- pop cx
- pop bx
- mov sp,bp
- pop bp
- ret numret
-
- endm
-
- Locate_Cursor macro functype
-
- mov ah,2 ; set cursor call
- push si ; save pointer
- int 10h ; dx already set, so go ahead
- pop si ; get pointer back
- inc dl ; increment column count
- cmp dl,mode_info.mode_cols ; is it too high
- jl f&functype&_10 ; it is ok
- sub dl,mode_info.mode_cols ; subtract the number of screen columns
- inc dh ; increment the row
-
- f&functype&_10:
-
- endm
-
- Check_Handle macro functype
-
- mov ax,[bp+6] ; get handle
- or ax,ax ; is it zero
- jz f&functype&_1 ; it is ok
- mov ax,436 ; bad handle
- jmp SHORT f&functype&_out ; return
-
- f&functype&_1:
-
- endm
-
- Do_Row_Col macro functype,row,col
-
- mov ax,[bp+row] ; get row
- cmp ax,0 ; is it less than 0
- jae f&functype&_2 ; ok so far
- mov ax,358 ; bad row
- jmp SHORT f&functype&_out ; get out
- f&functype&_2:
- cmp ax,mode_info.mode_rows ; is it greater than the max?
- jb f&functype&_3 ; ok so far
- mov ax,358 ; bad row
- jmp SHORT f&functype&_out ; get out
- f&functype&_3:
- mul byte ptr mode_info.mode_cols
- mov di,ax ; save this
- mov ax,[bp+col] ; get column
- cmp ax,0 ; is it less than 0
- jae f&functype&_4 ; ok so far
- mov ax,359 ; bad column
- jmp SHORT f&functype&_out ; get out
- f&functype&_4:
- cmp ax,mode_info.mode_cols ; is it greater than the max?
- jb f&functype&_5 ; ok so far
- mov ax,359 ; bad column
- jmp SHORT f&functype&_out ; get out
- f&functype&_5:
- add di,ax ; add in the column offset
- shl di,1 ; multiply by 2
-
- endm
-
- Scroll_Stuff macro functype,scrltype
-
- mov ax,[bp+20] ; get top row
- mov ch,al ; put in place
- mov ax,[bp+18] ; get left column
- mov cl,al ; put in place
- mov ax,[bp+16] ; get bottom row
- mov dh,al ; put in place
- mov ax,[bp+14] ; get right column
- mov dl,al ; put in place
- lds si,[bp+8] ; get pointer to cell
- lodsw ; get the cell to use
- mov bh,ah ; put attribute in place
- mov ax,[bp+12] ; get lines to scroll
- or ax,ax ; is it 0?
- jne f&functype&_20 ; no, so go on
- mov ax,0 ; nothing to do, so return good
- jmp SHORT f&functype&_out ; go away
-
- f&functype&_20:
- cmp ax,-1 ; if it is -1, make it 0
- jne f&functype&_21 ; its not, so go on
- xor ax,ax ; make it 0
-
- f&functype&_21:
- mov ah,scrltype ; scroll down BIOS call
- int 10h ; do the call
-
- endm
-