home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / NUBYE / NUBY-INS.LBR / NUR3-1.IQS / nur3-1.ins
Text File  |  1986-04-26  |  3KB  |  122 lines

  1. ; NUR3-1.INS - TRS-80 Model III insert for NUBYE - 04/21/86
  2. ;
  3. ; TR1602 I/O and BR19411 baudrate generator
  4. ;
  5. ; Note:  This is an insert not an overlay
  6. ;
  7. ; There were a few different suppliers of hardware modifications to
  8. ; enable CP/M support on the TRS-80 Mod III.  If you have trouble
  9. ; with this insert, try the insert for the Mod IV (NUR4-x.INS).
  10. ;
  11. ; ========
  12. ;
  13. ; 04/21/86  Modified for NUBYE.  The above description was also wrong --
  14. ;        Only the Model III required a hardware mod for CP/M support,
  15. ;        NOT the Mod IV which runs Montezuma Micro CP/M...
  16. ;                        - Tom Brady
  17. ; 07/17/85  Written to work with BYE5        - Irv Hoff
  18. ;
  19. ; ========
  20. ;
  21. ; Modem port equates
  22. ;
  23. PORT    EQU    0EBH        ; Modem port
  24. MDCTL1    EQU    PORT-1        ; Status port
  25. MDCTL2    EQU    PORT-2        ; Baud rate port
  26. MDCTL3    EQU    PORT-3        ; Reset port
  27. ;
  28. MDRCV    EQU    80H        ; Data available
  29. MDSND    EQU    40H        ; Xmit buffer empty
  30. MDDCD    EQU    20H        ; Data carrier detect
  31. ;
  32. B300    EQU    55H        ; 300 baud
  33. B1200    EQU    77H        ; 1200 bps
  34. B2400    EQU    0AAH        ; 2400 bps
  35. ;
  36. ; See if we still have a carrier - if not, return with the zero flat set
  37. ;
  38. MDCARCK:IN    MDCTL3        ; Read port
  39.     ANI    MDDCD        ; Mask carrier detect
  40.     RET
  41. ;
  42. ; Disconnect and wait for an incoming call
  43. ;
  44. MDINIT:    MVI    A,01        ; Reset UART, enable modem control
  45.     OUT    MDCTL3
  46.     MVI    A,68H        ; DTR, RTS off to hang up phone
  47.     OUT    MDCTL1
  48.     PUSH    B
  49.     MVI    B,20        ; 2 seconds to let modem settle down
  50. ;
  51. MDINIT1:CALL    DELAY
  52.     DCR    B
  53.     JNZ    MDINIT1
  54.     POP    B
  55.     MVI    A,6BH        ; Turn DTR back on
  56.     OUT    MDCTL1
  57. ;
  58.      IF    IMODEM
  59.     CALL    IMINIT
  60.      ENDIF            ; IMODEM
  61. ;
  62.     RET
  63. ;
  64. ; Input a character from the modem port
  65. ;
  66. MDINP:    IN    PORT        ; Get character
  67.     RET
  68. ;
  69. ; Check the status to see if a character is available.    If not, return
  70. ; with the zero flag set.  If yes, use 0FFH to clear the flag.
  71. ;
  72. MDINST:    IN    MDCTL1        ; Read port
  73.     ANI    MDRCV        ; Mask crap
  74.     RZ            ; Nope, nothing there
  75.     ORI    0FFH        ; We got something...
  76.     RET
  77. ;
  78. ; Send a character to the modem
  79. ;
  80. MDOUTP:    OUT    PORT        ; Send it
  81.     RET
  82. ;
  83. ; See if the output is ready for another character
  84. ;
  85. MDOUTST:IN    MDCTL1        ; Read port
  86.     ANI    MDSND        ; Mask crap
  87.     RET
  88. ;
  89. ; Reinitialize the modem and hang up the phone by dropping DTR and
  90. ; leaving it inactive.
  91. ;
  92. MDQUIT:     IF    IMODEM
  93.     CALL    IMQUIT        ; Tell smartmodem to shut down
  94.      ENDIF            ; IMODEM
  95. ;
  96. ; Called by main program after caller has typed BYE
  97. ;
  98. MDSTOP:    MVI    A,68H        ; Turn off DTR so that modem will quit
  99.     OUT    MDCTL1
  100.     RET
  101. ;
  102. ; The following routine sets the baudrate.  NUBYE asks for the maximum
  103. ; speed you have available.
  104. ;
  105. SETINV:    ORI    0FFH        ; Make sure the zero flag is not set
  106.     RET
  107. ;
  108. SET300:    MVI    A,B300
  109.     JMP    SETBAUD
  110. ;
  111. SET1200:MVI    A,B1200
  112.     JMP    SETBAUD
  113. ;
  114. SET2400:MVI    A,B2400
  115. ;
  116. SETBAUD:OUT    MDCTL2
  117.     XRA    A
  118.     RET
  119. ;
  120. ; end of insert
  121. ; -------------
  122.