home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / SUPER_C.ZIP / V3LIB.ASM < prev    next >
Encoding:
Assembly Source File  |  1980-01-01  |  1.5 KB  |  35 lines

  1. ;               Equipment Configuration Library
  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. ; _setPal(colorID,color)
  7. ;
  8. ; Function: Set the palette color ID to the color given.
  9. ;
  10. ; Algorithm: Call ROM BIOS set palette video function.
  11.  
  12.         public  _setPal         ; Routine is available to other modules
  13.  
  14.         colorID = 4             ; The offset to the color ID parameter
  15.         color = 6               ; The offset to the color parameter
  16.  
  17. _setPal proc near               ; NEAR type subroutine
  18.         push    bp              ; Save the BP register
  19.         mov     bp,sp           ; Set BP to SP, so we can access parameters
  20.         push    si              ; Save the SI register
  21.         push    di              ; Save the DI register
  22.         mov     bh,[bp+colorID] ; Set BH to the color ID
  23.         mov     bl,[bp+color]   ; Set BL to the color
  24.         mov     ah,11           ; Function 11: set palette
  25.         int     10H             ; Call the ROM BIOS with interrupt 10 (video)
  26.         pop     di              ; Restore the DI register
  27.         pop     si              ; Restore the SI register
  28.         pop     bp              ; Restore BP
  29.         ret                     ; Return to calling program
  30. _setPal endp                    ; End of subroutine
  31.  
  32. _TEXT   ends                    ; End of code segment
  33.         end                     ; End of assembly code
  34.  
  35.