home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / misc / generic.lbr / GNRC52X.AZM / GNRC52X.ASM
Encoding:
Assembly Source File  |  1993-10-25  |  2.8 KB  |  121 lines

  1. ;==================================================+
  2. ;                           |
  3. ; TITLE:  GENERIC.ASM                   |
  4. ;      GENERIC.DOC --> .ASM Version    (52 COLUMNS)
  5. ;                           |
  6. ; AUTHOR:  Richard Altman    DATE:  10/15/91    |
  7. ;                           |
  8. ; See    XXXMSG:  toward the end of this file.       |
  9. ;    ~~~~~~                       |
  10. ;==================================================+
  11. ;
  12. BEL    EQU    07H
  13. TAB    EQU    09H
  14. CR    EQU    0DH
  15. LF    EQU    0AH
  16. CLS    EQU    1AH
  17. CLX    EQU    17H
  18. ESC    EQU    1BH
  19. APOS    EQU    27H    ; Apostrophe
  20. ;
  21. ;  BDOS equates
  22. ;
  23. BDOS    EQU    0005H
  24. WRTCHR    EQU    2    ; Write character to console
  25.     ORG    0100H
  26. ;
  27. ;=================================================
  28. ;
  29.  
  30. START:    LXI    H,0
  31.     DAD    SP        ; HL=old stack
  32.     SHLD    STACK        ; Save it
  33.     LXI    SP,STACK    ; Get new stack
  34.     XRA    A
  35.     STA    CLRFLG    ; Clear file found flag
  36.     MVI    C,12    ; Get/save CP/M version #
  37.     CALL    BDOS
  38.     MOV    A,L
  39.     STA    VERFLG
  40.     CPI    20H    ; Set carry if CP/M 1.4
  41.     JC    VERBAD    ; Exit on earlier than 2.0
  42.     LXI    D,XXXMSG    ; Display XXXMSG
  43.     CALL    PRINT
  44. EXIT:    LHLD    STACK    ; Get old stack pointer
  45.     SPHL        ; Move back to old stack
  46.     RET        ; And return to CCP
  47. ;
  48. PRINT:    LDAX    D
  49.     ORA    A
  50.     RZ            ; If zero, finished
  51.     CALL    PRINTA        ; Display on CRT
  52.     INX    D
  53.     JMP    PRINT
  54. ;
  55. PRINTA:    PUSH    B
  56.     PUSH    D
  57.     PUSH    H
  58.     PUSH    PSW
  59.     CALL    PRINTB
  60.     POP    PSW
  61.     POP    H
  62.     POP    D
  63.     POP    B
  64.     RET
  65. ;
  66. PRINTB:    MOV    E,A        ; Get character into
  67.     MVI    C,WRTCHR    ;  BDOS entry reg.
  68.     JMP    BDOS        ; Call CONOUT via BDOS
  69. ;
  70. VERBAD:    LXI    D,VERMSG    ; Abort,
  71.     CALL    PRINT        ;    bad CP/M version
  72.     JMP    EXIT
  73. ;
  74. ;=================================================
  75. ;
  76. ;     NOTE:   As long as you enclose your message
  77. ;    in single quotes, you can print virtually
  78. ;    anything you want on the screen.
  79. ;
  80. ;    Use DB at the beginning of each message
  81. ;    line in this file.
  82. ;
  83. ;    Use CR,LF at the end of each line to be
  84. ;    displayed on screen.
  85. ;
  86. ;    Always END the message with a ZERO (0).
  87. ;
  88.  
  89. XXXMSG: DB    CLS,CR,LF,TAB,'This is a GENERIC '
  90.     DB    'MESSAGE.',CR,LF,LF,LF
  91.     DB    'Use  ASM ________.AAZ  and  '
  92.     DB    'LOAD ________  to produce',CR,LF
  93.     DB    LF,'     a new Assembly Version '
  94.     DB    'of a .DOC file.',CR,LF,LF,LF
  95.     DB    'This is Line #1 of a general '
  96.     DB    'message .......',CR,LF
  97.     DB    'This is Line #2 of a general '
  98.     DB    'message .......',CR,LF
  99.     DB    'This is Line #3 of a general '
  100.     DB    'message .......',CR,LF
  101.     DB    'This is Line #4 of a general '
  102.     DB    'message .......',CR,LF
  103.     DB    'This is Line #5 of a general '
  104.     DB    'message .......',CR,LF
  105.     DB    LF,TAB,'etc.   etc.   etc.',CR,LF
  106.     DB    LF,LF,BEL,0
  107. VERMSG:    DB    '>>>>>   Needs CP/M 2.0 or newer '
  108.     DB    'to RUN',CR,LF,0
  109. ;
  110. CLRFLG:    DB    0    ; File found flag
  111. VERFLG:    DB    0    ; CP/M version number
  112. ;            ; (0= not CP/M 2.0 or newer)
  113. ;
  114.     DS    100    ; Stack area
  115. STACK:    DS    2    ; Save old stack pointer here
  116. ;
  117. ORDER    EQU    $    ; Order table starts here
  118. ;
  119.     END
  120.  
  121.