home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / EGA_VGA / EGACOLRS.ZIP / SETMODE.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-10-30  |  2.6 KB  |  56 lines

  1. ;════════════════════════════════════════════════════════════════════════════╗
  2. ; SCRMODE()                                                                  ║
  3. ; Paul V. Slabowski                                                          ║
  4. ; October 28, 1988                                                           ║
  5. ;                                                                            ║
  6. ; Set the video mode to 3 (EGA ONLY)                                         ║
  7. ;                                                                            ║
  8. ; ex: Scrmode()                                                              ║
  9. ;                                                                            ║
  10. ;════════════════════════════════════════════════════════════════════════════╝
  11.  
  12. PUBLIC SCRMODE                            ; Declare this function public
  13.  
  14. EXTRN     __PARINFO:FAR                   ; Declare far functions
  15. EXTRN     __RET:FAR
  16.  
  17. _SCRMD    segment   byte   'PROG'
  18.      ASSUME     cs:_SCRMD
  19.  
  20. SCRMODE   PROC  FAR
  21.  
  22.     setup:      push    bp                ; Save registers
  23.                 mov     bp,sp             ;       ·
  24.                 push    ds                ;       ·
  25.                 push    es                ;       ·
  26.                 push    si                ;       ·
  27.                 push    di                ;       ·
  28.  
  29.     parnumb:    mov     ax, 0             ; Set up call for # of params
  30.                 push    ax                ;       ·
  31.                 call    __PARINFO         ; Call Clipper function to get
  32.                                           ;    # of params into ax
  33.                 add     sp, 2             ; restore stack
  34.                 cmp     ax, 0             ; If # of parameters sent was,
  35.                 jne     quit              ;    not 0, then quit here,
  36.                                           ;    otherwise...
  37.  
  38.     doscall:    mov     ah, 00h           ; Load registers for DOS call
  39.                 mov     al, 03h           ; Set screen mode 3 function
  40.                 int     10h               ; Call to BIOS:Video Drivers
  41.  
  42.     quit:       pop     di                ; Restore registers
  43.                 pop     si                ;         ·
  44.                 pop     es                ;         ·
  45.                 pop     ds                ;         ·
  46.                 pop     bp                ;         ·
  47.  
  48.     clean:      call    __RET             ; Call Clipper function for return
  49.                 ret                       ; Actual return
  50.  
  51. SCRMODE         ENDP                      ; End of process
  52.  
  53. _SCRMD  ENDS
  54.         END
  55.  
  56. ; eof setmode.asm