home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 August / PCO0897.ISO / filesbbs / dos / bdos_xr5.arj / VFOSSIL / VFOS_SRC.ZIP / MACROS.INC < prev    next >
Encoding:
Text File  |  1992-12-12  |  4.2 KB  |  127 lines

  1. ;
  2. ; VFOS_IBM VFOSSIL driver by Bob Hartman.
  3. ; Copyright 1988 by Spark Software.  ALL RIGHTS RESERVED.
  4. ;
  5.  
  6. Enter_Vio macro
  7.  
  8.         push    bp
  9.         mov     bp,sp
  10.         push    bx
  11.         push    cx
  12.         push    dx
  13.         push    si
  14.         push    di
  15.         push    ds
  16.         push    es
  17.  
  18.         push    cs
  19.         pop     ds
  20.  
  21.         endm
  22.  
  23. Exit_Vio macro  functype,numret
  24.  
  25. f&functype&_out:
  26.         pop     es
  27.         pop     ds
  28.         pop     di
  29.         pop     si
  30.         pop     dx
  31.         pop     cx
  32.         pop     bx
  33.         mov     sp,bp
  34.         pop     bp
  35.         ret     numret
  36.  
  37.         endm
  38.  
  39. Locate_Cursor macro functype
  40.  
  41.         mov     ah,2                    ; set cursor call
  42.         push    si                      ; save pointer
  43.         int     10h                     ; dx already set, so go ahead
  44.         pop     si                      ; get pointer back
  45.         inc     dl                      ; increment column count
  46.         cmp     dl,mode_info.mode_cols  ; is it too high
  47.         jl      f&functype&_10          ; it is ok
  48.         sub     dl,mode_info.mode_cols  ; subtract the number of screen columns
  49.         inc     dh                      ; increment the row
  50.  
  51. f&functype&_10:
  52.  
  53.         endm
  54.  
  55. Check_Handle macro functype
  56.  
  57.         mov     ax,[bp+6]               ; get handle
  58.         or      ax,ax                   ; is it zero
  59.         jz      f&functype&_1           ; it is ok
  60.         mov     ax,436                  ; bad handle
  61.         jmp     SHORT f&functype&_out         ; return
  62.  
  63. f&functype&_1:
  64.  
  65.         endm
  66.  
  67. Do_Row_Col macro functype,row,col
  68.  
  69.         mov     ax,[bp+row]             ; get row
  70.         cmp     ax,0                    ; is it less than 0
  71.         jae     f&functype&_2           ; ok so far
  72.         mov     ax,358                  ; bad row
  73.         jmp     SHORT f&functype&_out         ; get out
  74. f&functype&_2:
  75.         cmp     ax,mode_info.mode_rows  ; is it greater than the max?
  76.         jb      f&functype&_3           ; ok so far
  77.         mov     ax,358                  ; bad row
  78.         jmp     SHORT f&functype&_out         ; get out
  79. f&functype&_3:
  80.         mul     byte ptr mode_info.mode_cols
  81.         mov     di,ax                   ; save this
  82.         mov     ax,[bp+col]             ; get column
  83.         cmp     ax,0                    ; is it less than 0
  84.         jae     f&functype&_4           ; ok so far
  85.         mov     ax,359                  ; bad column
  86.         jmp     SHORT f&functype&_out         ; get out
  87. f&functype&_4:
  88.         cmp     ax,mode_info.mode_cols  ; is it greater than the max?
  89.         jb      f&functype&_5           ; ok so far
  90.         mov     ax,359                  ; bad column
  91.         jmp     SHORT f&functype&_out         ; get out
  92. f&functype&_5:
  93.         add     di,ax                   ; add in the column offset
  94.         shl     di,1                    ; multiply by 2
  95.  
  96.         endm
  97.  
  98. Scroll_Stuff macro functype,scrltype
  99.  
  100.         mov     ax,[bp+20]              ; get top row
  101.         mov     ch,al                   ; put in place
  102.         mov     ax,[bp+18]              ; get left column
  103.         mov     cl,al                   ; put in place
  104.         mov     ax,[bp+16]              ; get bottom row
  105.         mov     dh,al                   ; put in place
  106.         mov     ax,[bp+14]              ; get right column
  107.         mov     dl,al                   ; put in place
  108.         lds     si,[bp+8]               ; get pointer to cell
  109.         lodsw                           ; get the cell to use
  110.         mov     bh,ah                   ; put attribute in place
  111.         mov     ax,[bp+12]              ; get lines to scroll
  112.         or      ax,ax                   ; is it 0?
  113.         jne     f&functype&_20          ; no, so go on
  114.         mov     ax,0                    ; nothing to do, so return good
  115.         jmp     SHORT f&functype&_out         ; go away
  116.  
  117. f&functype&_20:
  118.         cmp     ax,-1                   ; if it is -1, make it 0
  119.         jne     f&functype&_21          ; its not, so go on
  120.         xor     ax,ax                   ; make it 0
  121.  
  122. f&functype&_21:
  123.         mov     ah,scrltype             ; scroll down BIOS call
  124.         int     10h                     ; do the call
  125.  
  126.         endm
  127.