home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l440 / 2.ddi / CHAP6 / EEA.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-09-27  |  1.8 KB  |  79 lines

  1. ;       EEA.ASM - support for EnvEdt.C
  2.  
  3. .model small,c
  4.  
  5. .code
  6.  
  7. max_xy  proc    x:word,y:word
  8.  
  9.         public  max_xy
  10. ; void max_xy( int *x, int *y );
  11.         mov     ax,1130h        ; try EGA/VGA routines
  12.         xor     dx,dx
  13.         push    bp              ; save BP around INT 10h
  14.         int     10h             ; in case we're running on
  15.         pop     bp              ; an old BIOS that trashes BP
  16.         or      dl,dl
  17.         jnz     mxy2            ; nope, not EGA or VGA
  18.         mov     dl,24           ; so set for 25 lines
  19. mxy2:   xor     dh,dh
  20.         inc     dx
  21.         mov     bx,y
  22.         mov     ds:[bx],dx      ; store maxy value
  23.  
  24.         mov     ah,0fh          ; use bios mode call
  25.         push    bp
  26.         int     10h
  27.         pop     bp
  28.         xchg    ah,al
  29.         cbw
  30.         mov     bx,x
  31.         mov     ds:[bx],ax      ; store maxx value
  32.         ret
  33. max_xy  endp
  34.  
  35. col     proc
  36.  
  37.         public  col
  38. ; int col( void );
  39.         mov     ah,3            ; Get Cursor Position
  40.         xor     bx,bx
  41.         push    bp
  42.         int     10h
  43.         pop     bp
  44.         mov     al,dl           ; return x coordinate
  45.         cbw
  46.         ret
  47. col     endp
  48.  
  49. row     proc
  50.  
  51.         public  row
  52. ; int row( void );
  53.         mov     ah,3            ; Get Cursor Position
  54.         xor     bx,bx
  55.         push    bp
  56.         int     10h
  57.         pop     bp
  58.         mov     al,dh           ; return y coordinate
  59.         cbw
  60.         ret
  61. row     endp
  62.  
  63. setrc   proc    r:byte, c:byte
  64.  
  65.         public  setrc
  66. ; void setrc( int r, int c );
  67.         xor     bx,bx
  68.         mov     dl,c
  69.         mov     dh,r
  70.         mov     ah,2            ; Set Cursor Position
  71.         push    bp
  72.         int     10h
  73.         pop     bp
  74.         ret
  75.  
  76. setrc   endp
  77.  
  78.         end
  79.