home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Assembly / CURSOR17.ASM < prev    next >
Assembly Source File  |  1986-09-24  |  2KB  |  73 lines

  1. CR        EQU    13        ;Carriage return
  2. LF        EQU    10        ;Line feed
  3.  
  4. CGROUP    GROUP    CODE_SEG
  5.     ASSUME    CS:CGROUP
  6.  
  7. CODE_SEG    SEGMENT PUBLIC
  8.  
  9.     PUBLIC    CLEAR_SCREEN
  10. ;-----------------------------------------------------------------------;
  11. ; This procedure clears the entire screen.                ;
  12. ;-----------------------------------------------------------------------;
  13. CLEAR_SCREEN    PROC    NEAR
  14.     PUSH    AX
  15.     PUSH    BX
  16.     PUSH    CX
  17.     PUSH    DX
  18.     XOR    AL,AL            ;Blank entire window
  19.     XOR    CX,CX            ;Upper left corner is at (0,0)
  20.     MOV    DH,24            ;Bottom line of screen is line 24
  21.     MOV    DL,79            ;Right side is at column 79
  22.     MOV    BH,7            ;Use normal attribute for blanks
  23.     MOV    AH,6            ;Call for SCROLL-UP function
  24.     INT    10h            ;Clear the window
  25.     POP    DX
  26.     POP    CX
  27.     POP    BX
  28.     POP    AX
  29.     RET
  30. CLEAR_SCREEN    ENDP
  31.  
  32.  
  33.     PUBLIC    GOTO_XY
  34. ;-----------------------------------------------------------------------;
  35. ; This procedure moves the cursor                    ;
  36. ;                                    ;
  37. ;    DH    Row (Y)                            ;
  38. ;    DL    Column (X)                        ;
  39. ;-----------------------------------------------------------------------;
  40. GOTO_XY        PROC    NEAR
  41.     PUSH    AX
  42.     PUSH    BX
  43.     MOV    BH,0            ;Display page 0
  44.     MOV    AH,2            ;Call for SET CURSOR POSITION
  45.     INT    10h
  46.     POP    BX
  47.     POP    AX
  48.     RET
  49. GOTO_XY        ENDP
  50.  
  51.     PUBLIC    SEND_CRLF
  52. ;-----------------------------------------------------------------------;
  53. ; This routine just sends a carriage return-line feed pair to the    ;
  54. ; display, using the DOS routines so that scrolling will be handled    ;
  55. ; correctly.                                ;
  56. ;-----------------------------------------------------------------------;
  57. SEND_CRLF    PROC    NEAR
  58.     PUSH    AX
  59.     PUSH    DX
  60.     MOV    AH,2
  61.     MOV    DL,CR
  62.     INT    21h
  63.     MOV    DL,LF
  64.     INT    21h
  65.     POP    DX
  66.     POP    AX
  67.     RET
  68. SEND_CRLF    ENDP
  69.  
  70. CODE_SEG    ENDS
  71.  
  72.     END
  73.