home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT8 / CURSON.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-05-10  |  1.6 KB  |  34 lines

  1. ;
  2. ;       Program CursOn ( Chapter 8 )
  3. ;
  4.     page    55,132
  5. .model small
  6. .code
  7.     org     100h            ; This is needed for COM-files
  8. ;===    Block 1: Get equipment information      
  9. Begin:                          ; The program starts here
  10.     int     11h             ; BIOS service - get equipment information
  11.     and     al,30h          ; Emphasize bits 4,5 - display mode
  12.     cmp     al,30h          ; Bits 4 and 5 are set - Monochrome
  13.     je      Mono            ; Process monochrome display
  14. ;===    Block 2: Enable CGA cursor emulation    
  15. ;       mov     ah,11h          ; Function 11h - Character set service
  16. ;       mov     al,0            ; Allow cursor emulation
  17. ;       mov     bl,34h          ; Subfunction 34h - Cursor emulation
  18. ;       int     10h             ; BIOS video service
  19.     mov     cx,0607h        ; CGA cursor locates within lines 6 - 7
  20.     jmp     SetCur
  21. ;===    Block 3: Set cursor parameters - monochrome mode
  22. Mono:   mov     cx,0B0Dh        ; MDA/HGC cursor locates within lines 13 - 14
  23. ;       Block 4: Set cursor parameters - color mode     
  24. SetCur: mov     ax,40h          ; Segment address of BIOS data area
  25.     mov     es,ax           ; ES will point to the BIOS data area
  26. ;       mov     al,es:49h       ; AL - current video mode for some buggy BIOS 
  27. ;       mov     bh,es:62h       ; BH contains the number of active video page
  28.     mov     ah,01h          ; Function 01 - Set cursor type
  29.     int     10h             ; BIOS video service call
  30. ;===    Block 5: Exit program   
  31. ExProg: mov     ax,4C00h        ; Function 4Ch - terminate process, exit code 0
  32.     int     21h             ; DOS service call
  33.     end     Begin 
  34.