home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / alde_c / misc / util / super_c / v4lib.asm < prev    next >
Encoding:
Assembly Source File  |  1980-01-01  |  3.3 KB  |  74 lines

  1. ;               Text Video Library (part 4)
  2.  
  3. _TEXT   segment byte public 'CODE'      ; Place the code in the code segment
  4.         assume  CS:_TEXT                ; Assume the CS register points to it
  5.  
  6. ; _putDot(page,row,col,color)
  7. ;
  8. ; Function: Write a dot to the screen on the page, row, and column specified.
  9. ; Write it in color color. Note that page is only used with the EGA, and
  10. ; the range of valid colors depends on the adapter and mode being used.
  11. ;
  12. ; Algorithm: Call the ROM BIOS put dot function; int 10H, AH = 12.
  13.  
  14.         public  _putDot         ; Routine is available to other modules
  15.  
  16.         page = 4                ; Offset from BP to parameter page
  17.         row = 6                 ; Offset to parameter row
  18.         col = 8                 ; Offset to col
  19.         color = 10              ; Offset to color
  20.  
  21. _putDot proc near               ; NEAR type subroutine
  22.         push    bp              ; Save BP register
  23.         mov     bp,sp           ; Set BP to SP; easier to get parameters
  24.         push    si              ; Save SI
  25.         push    di              ; Save DI
  26.         mov     bh,[bp+page]    ; Set BH to the page
  27.         mov     dx,[bp+row]     ; Set DX to the row
  28.         mov     cx,[bp+col]     ; Set CX to the column
  29.         mov     al,[bp+color]   ; Set AL to the color
  30.         mov     ah,12           ; Set AH to 12 (put dot function)
  31.         int     10H             ; Call ROM BIOS video interrupt
  32.         pop     di              ; Restore the DI register
  33.         pop     si              ; Restore the SI register
  34.         pop     bp              ; Restore the BP register
  35.         ret                     ; Return to calling program
  36. _putDot endp                    ; End of subroutine
  37.  
  38. ; _getDot(page,row,col)
  39. ;
  40. ; Function: Return the color of the dot at the page, row, and column given.
  41. ; Note: The page specification is only meaningfull when using the EGA, and
  42. ; the color returned will be constrained to a range that depends on the
  43. ; display adapter and mode being used.
  44. ;
  45. ; Algorithm: Call the ROM BIOS get dot function; int 10H, AH = 13.
  46.  
  47.         public  _getDot         ; Routine is available to other modules
  48.  
  49.         page = 4                ; Offset from BP to parameter page
  50.         row = 6                 ; Offset to parameter row
  51.         col = 8                 ; Offset to col
  52.  
  53. _getDot proc near               ; NEAR type subroutine
  54.         push    bp              ; Save BP register
  55.         mov     bp,sp           ; Set BP to SP; easier to get parameters
  56.         push    si              ; Save SI
  57.         push    di              ; Save DI
  58.         mov     bh,[bp+page]    ; Set BH to the page
  59.         mov     dx,[bp+row]     ; Set DX to the row
  60.         mov     cx,[bp+col]     ; Set CX to the column
  61.         mov     ah,13           ; Set AH to 13 (get dot function)
  62.         int     10H             ; Call ROM BIOS video interrupt
  63.         xor     ah,ah           ; Zero the top byte of the return value
  64.         pop     di              ; Restore the DI register
  65.         pop     si              ; Restore the SI register
  66.         pop     bp              ; Restore the BP register
  67.         ret                     ; Return to calling program
  68. _getDot endp                    ; End of subroutine
  69.  
  70. _TEXT   ends                    ; End of code segment
  71.  
  72.         end                     ; End of assembly code
  73.  
  74.