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 / IMP / I2OV-3.AZM / I2OV-3.ASM
Assembly Source File  |  2000-06-30  |  16KB  |  545 lines

  1.  
  2. ; I2OV-3.ASM - Osborne Vixen/OCC4 overlay file for IMP - 06/01/87
  3. ;
  4. ;        8251A IO and 8155 baudrate generator
  5. ;
  6. ; The Osborne Vixen/OCC4 requires that pin 5 on its serial port be con-
  7. ; nected to an RS-232 pin which has a "SPACE" signal present.  This sig-
  8. ; nal can be found on most RS-232 modems as pin 5 (CLEAR TO SEND - CTS).
  9. ; The Vixen is already wired as "DCE" not "DTE", so no cross-wiring from
  10. ; 2 and 3 is needed as in most computers.  The cable between the Vixen
  11. ; OCC4 and your modem should contain the following.  The optional wire
  12. ; is not needed for use with IMP, but would be needed if used with BYE3
  13. ; for RCPM use:
  14. ;
  15. ;           VIXEN          MODEM
  16. ;         2 ------------ 2    TXD data out
  17. ;         3 ------------ 3    RXD data in
  18. ;         5 ------------ 5    CTS, required
  19. ;         6 ------------ 8    (*)
  20. ;         7 ------------ 7    ground
  21. ;        20 ------------ 20    DTR
  22. ;
  23. ;    (*) Required for BYE3 or BYE5, unnecessary otherwise
  24. ;
  25. ;-----------------------------------------------------------------------
  26. ;
  27. ; Edit this file for your preferences then follow the "TO USE:" example
  28. ; shown below.
  29. ;
  30. ; Many terminals will clear the screen with a CTL-Z.  If yours does, put
  31. ; a 1AH at CLEAR: (010AH).  Many terminals use two characters, the first
  32. ; normally an ESC.  For example, ESC *.  In this case put '*' at CLEAR:
  33. ; (The ESC will automatically be typed with no CTL-character present.)
  34. ; If you don't know what your terminal uses, put a 0 at CLEAR: and IMP
  35. ; will scroll up 24 blank lines to clear the CRT for things like MENU,
  36. ; looking at the function key table, typing CTL-Z in command mode, etc.
  37. ;
  38. ; Use the "SET" command to change the baudrate when desired.  The value
  39. ; at MSPEED controls the baudrate when the program is first called up.
  40. ;
  41. ;    TO USE: First edit this file filling in answers for your own
  42. ;        equipment.  Then assemble with ASM.COM or equivalent
  43. ;        assembler.  Then use MLOAD to merge into the main file:
  44. ;
  45. ;        MLOAD IMP.COM=IMP.COM,I2DP-x.HEX
  46. ;
  47. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  48. ;
  49. ; 06/01/87  Improved the GOODBYE routine, added BREAK routine, needs
  50. ;        IMP245 to use it.            - Irv Hoff
  51. ; 08/07/85  Diagram clarified, no other change    - Roy Robinson
  52. ; 07/17/85  Adapted for use with IMP        - Irv Hoff
  53. ; 02/10/85  Modified for Osborne Vixen/OCC-4    - Roy Robinson
  54. ;
  55. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  56. ;
  57. ;
  58. YES    EQU    0FFH
  59. NO    EQU    0
  60. ;
  61. ;
  62. ; Values shown are for a 8251A
  63. ;
  64. PORT    EQU    30H    ; Your base port (data or status)
  65. MDCTL1    EQU    PORT+1    ; Modem control port
  66. MDDATP    EQU    PORT    ; Modem data port
  67. MDRCV    EQU    02H    ; Modem receive ready
  68. MDSND    EQU    01H    ; Modem send ready bit
  69. MDTXE    EQU    05H    ; Modem send buffer empty, holding buffer empty
  70. ;
  71. MDMODE    EQU    82H    ; Insures 8251 is out of mode with DTR high
  72. MDRSET    EQU    42H    ; Resets USART for additional commands
  73. MDSET1    EQU    4EH    ; 1 stop bit, no parity, 8 bits, x16
  74. MDSET2    EQU    0CEH    ; 2 stop bits, no parity, 8 bits, x16
  75. MDCOM    EQU    37H    ; Reset error flags, RTS, Rxd, DTR, Txd on
  76. ;
  77. AJUMP    EQU    0C3H    ; JUMP instruction opcode
  78. BDOS    EQU    0005H    ; Address of BDOS entry point in 1st page of RAM
  79. BIOS    EQU    0001H    ; Pntr address of CP/M warm boot jump in BIOS
  80. EXITCPM    EQU    2C80H    ; Address of CP/M warm boot jump in EXIT routine
  81. INTVEC    EQU    0EFFEH    ; Address of interrupt vector to first interrupt
  82.             ;   service routine
  83. ;
  84. ;-----------------------------------------------------------------------
  85. ;
  86. ESC    EQU    '['-40H    ; ^[ = Escape
  87. BELL    EQU    'G'-40H    ; ^G = Bell character
  88. LF    EQU    'J'-40H    ; ^J = Linefeed
  89. NEXTRY    EQU    'K'-40H    ; ^K = Try next phone number, abort this try
  90. CR    EQU    'M'-40H    ; ^M = Carriage return
  91. CLEARSC    EQU    'Z'-40H    ; ^Z = Clears screen, command mode only
  92. EOFCHAR    EQU    'Z'-40H    ; ^Z = End of file
  93. ;
  94. ;
  95. ;-----------------------------------------------------------------------
  96. ;
  97. ;
  98.     ORG    0100H
  99. ;
  100. ;
  101.     DS    3    ; Skip the data area below
  102. ;
  103. ;
  104. ; These routines and equates are at the beginning of the program so
  105. ; they can be patched by a monitor or overlay file without re-assembling
  106. ; the program.
  107. ;
  108. MSPEED:     DB    6    ; 0=110 1=300 2=450 3=600 4=710 5=1200        103H
  109.             ; 6=2400 7=4800 8=9600 9=19200 default
  110. HS2400:     DB    YES    ; Yes=2400 bps highest speed            104H
  111. HS1200:     DB    NO    ; Yes=1200 bps highest speed            105H
  112. RACAL:     DB    NO    ; Yes=Racal-Vadic 1200V or 2400V or 2400PA    106H
  113. PROMODM: DB    NO    ; Yes=Prometheus ProModem 1200 bps        107H
  114. RESVD1:     DB    NO    ; Reserved for special modems            108H
  115. RESVD2:     DB    NO    ; Reserved for special modems            109H
  116. ;
  117. ;
  118. CLEAR:     DB    1AH    ; Clear screen character (ESC not needed)    10AH
  119. CLOCK:     DB    40    ; Clock speed in MHz x10, 25.5 MHz max.     10BH
  120.             ; 20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  121. BYTDLY:     DB    2    ; 0=0 delay  1=10ms  5=50 ms - 9=90 ms        10CH
  122.             ;   default time to send character in ter-
  123.             ;   minal mode file transfer for slow BBS
  124. CRDLY:     DB    2    ; 0=0 delay 1=100 ms 5=500 ms - 9=900 ms    10DH
  125.             ;   default time for extra wait after CRLF
  126.             ;   in terminal mode file transfer
  127. NOFCOL:     DB    5    ; Number of directory columns shown        10EH
  128. TCHPUL:     DB    'T'    ; T=tone, P=Pulse (Hayes 2400 modems)        10FH
  129. ;.....
  130. ;
  131. ;
  132. ADDLFD:     DB    NO    ; Yes=add LF after CR to send file in terminal    110H
  133.             ;   mode (normally added by remote echo)
  134. CONVRUB: DB    YES    ; Yes=convert rub to backspace            111H
  135. CRCDFLT: DB    YES    ; Yes=default to CRC checking            112H
  136. IGNRCTL: DB    YES    ; Yes=CTL-chars above ^M not displayed        113H
  137. ;.....
  138. ;
  139. ;
  140. EXTCHR:     DB    '['-40H    ; ESC = preceeds local control character    114H
  141. EXITCHR: DB    'E'    ; Exit character                115H
  142. FILESND: DB    'F'    ; Send file when in terminal mode        116H
  143. NOCONCT: DB    'N'    ; Disconnect from phone line            117H
  144. LOGCHR:     DB    'L'    ; Send logon                    118H
  145. LSTCHR:     DB    'P'    ; Toggle printer                119H
  146. UNSAVCH: DB    'R'    ; Close input text buffer            11AH
  147. SAVECHR: DB    'Y'    ; Open input text buffer            11BH
  148. CLEARS:     DB    'Z'    ; Clears screen, terminal mode            11CH
  149. BRKCHR:     DB    'Q'    ; Send a break tone                11DH
  150. NODTR:     DB    NO    ; YES if no DTR and need ATH0 to disconnect    11EH
  151. ;.....
  152. ;
  153. ;
  154. ; Handles in/out ports for data and status
  155. ;
  156. I$MDCTL1: DI            ;                    11FH
  157.       IN    MDCTL1        ;                    120H
  158.       EI            ;                    122H
  159.       RET            ; IN modem control port         123H
  160.       DB    0,0,0,0,0    ; Spares if needed            124H
  161. ;
  162. I$MDTXE:  DI            ;                    129H
  163.  
  164.       IN    MDCTL1        ; (Needed for SIO or DART register 1    12AH
  165.       EI            ;                    12CH
  166.       RET            ;                    12DH
  167.       DB    0,0,0,0,0    ;                    12EH
  168. ;
  169. I$MDDATP: DI            ;                    13DH
  170.       IN    MDDATP        ;                    13EH
  171.       EI            ;                    140H
  172.       RET            ;                    141H
  173.       DB    0,0,0,0,0    ; Spares if needed            142H
  174. ;
  175. O$MDDATP: EI
  176.       OUT    MDDATP        ;                    147H
  177.       DI
  178.       RET            ; OUT modem data port            149H
  179.       DB    0,0,0,0,0    ; Spares if needed            14AH
  180. ;.....
  181. ;
  182. ;
  183. A$MDRCV:  ANI    MDRCV        ;                    147H
  184.       RET            ;                    149H
  185. ;
  186. C$MDRCV:  CPI    MDRCV        ;                    14AH
  187.       RET            ;                    14CH
  188. ;
  189. A$MDSND:  ANI    MDSND        ;                    14DH
  190.       RET            ;                    14FH
  191. ;
  192. C$MDSND:  CPI    MDSND        ;                    150H
  193.       RET            ;                    152H
  194. ;
  195. A$MDTXE:  ANI    MDTXE        ;                    153H
  196.       RET            ;                    155H
  197. ;
  198. C$MDTXE:  CPI    MDTXE        ;                    156H
  199.       RET            ;                    158H
  200. ;.....
  201. ;
  202. ;
  203. ; Special exit vector, used by some computers to reset interrupt vectors
  204. ;
  205. J$EXITVEC:JMP    RSTINT        ;                    159H
  206.                 ;                    15AH
  207. ;.....
  208. ;
  209. ;
  210. ; Jump vectors needed by each overlay
  211. ;
  212. J$GOODBYE:JMP    GOODBYE        ; Disconnects modem by dropping DTR    15CH
  213. J$INITMOD:JMP    INITMOD        ; Initializes modem, autosets baudrate    15FH
  214. J$STUPR:  JMP    STUPR        ; SET routine to change baudrate    162H
  215. J$SYSVR:  JMP    SYSVR        ; Signon message            165H
  216. ;.....
  217. ;
  218. ;
  219. ; "AT" command strings, can be replaced in individual overlay if needed
  220. ;
  221. J$STRNGA: DS    3        ; 1200 bps "AT" string            168H
  222. J$STRNG1: DS    3        ; 2400 bps "AT" string            16BH
  223. ;
  224. ;
  225. ; Next fourteen lines should not be changed by user overlay as these go
  226. ; to specific locations in the main program, not in the overlay.
  227. ;
  228. ;
  229. J$CMDSPL: DS    3        ; Allows entry of baudrate on CMD line    16EH
  230. J$CRLF:      DS    3        ; Turns up one new line on display    171H
  231. J$DIAL:      DS    3        ; Start of dialing routine        174H
  232. J$DSCONT: DS    3        ; Terminates modem use            177H
  233. J$GOLST:  DS    3        ; Printer routine, needed by Apple //e    17AH
  234. J$ILPRT:  DS    3        ; Prints an inline string, 0 to end    17DH
  235. J$INBUF:  DS    3        ; Stores a keybd string for comparison    180H
  236. J$INLNCP: DS    3        ; Inline "compare strings" routine    183H
  237. J$INMDM:  DS    3        ; Max .1 sec wait for modem character    186H
  238. J$RCVRSP: DS    3        ; For 3801 I/O use (TV-803)        189H
  239. J$SNDCHR: DS    3        ; Sends a character to the modem    18CH
  240. J$SNDSTR: DS    3        ; Sends a string to the modem, $ to end 18FH
  241. J$TIMER:  DS    3        ; .1 second timer (amount in 'B' reg.)    192H
  242. J$BREAK:  JMP    SENDBRK        ; Break routine             195H
  243. J$NEW2:      DB    0,0,0        ; For future needs            198H
  244. ;.....
  245. ;
  246. ;
  247. ; For 2400 bps auto-stepdown units
  248. ;
  249. MANUAL:      DB    0        ; For manual selection flag        19BH
  250. J$300:      JMP    OK300        ; Sets baudrate to 300 baud        19CH
  251. J$1200:      JMP    OK1200        ; Sets baudrate to 1200 bps        19FH
  252. J$2400:      JMP    OK2400        ; Sets baudrate to 2400 bps        1A2H
  253. ;.....
  254. ;
  255. ;
  256. LOGPTR:      DW    LOGON        ; Pointer to display LOGON message    1A5H
  257. ;
  258. SYSVR:      CALL    J$ILPRT        ; Display the following line        1A7H
  259.       DB    'Version for Osborne Vixen/OCC 4',CR,LF    ;        1AAH
  260.       DB    CR,LF,0
  261.       RET
  262. ;.....
  263. ;
  264. ;
  265. ;-----------------------------------------------------------------------
  266. ;
  267. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  268. ;     end of your last routine should terminate by 0400H (601 bytes
  269. ;     available after start of SYSVER).
  270. ;
  271. ;-----------------------------------------------------------------------
  272. ;
  273. ; You can put in a message at this location which can be called up with
  274. ; (special character-L).  You can put in several lines.  End with a 0.
  275. ;
  276. LOGON:    DB    'Greetings from an Osborne Vixen user',CR,LF,0
  277. ;
  278. ;-----------------------------------------------------------------------
  279. ;
  280. ; This routine sets a 300 ms break tone
  281. ;
  282. SENDBRK:
  283.     MVI    A,3FH        ; DTR normal, send break tone
  284.     JMP    GOODBYE+2
  285. ;.....
  286. ;
  287. ;
  288. ; This routine sets DTR low for 300 ms to disonnect the phone
  289. ;
  290. GOODBYE:
  291.     MVI    A,3DH        ; Send break, turn off DTR
  292.     OUT    MDCTL1        ; Send to status port
  293.     MVI    B,3        ; Delay 300 ms to hang up phone
  294.     CALL    J$TIMER
  295.     MVI    A,37H        ; Normal send/receive with DTR
  296.     OUT    MDCTL1        ; Send to status port
  297.     RET
  298. ;.....
  299. ;
  300. ;
  301. OUTMDCTL1:
  302.     DI
  303.     OUT    MDCTL1
  304.     EI
  305.     RET
  306. ;.....
  307. ;
  308. ;
  309. ; You can use this area for any special initialization or setup you may
  310. ; wish to include.  Each must stop with a RET.    You can check the other
  311. ; available overlays for ideas how to write your own routines if that
  312. ; may be of some help.
  313. ;
  314. INITMOD:
  315.     MVI    C,7        ; Use BDOS to obtain current IOBYTE
  316.     CALL    BDOS        ;
  317.     STA    OLDIOB        ; Save old IOBYTE
  318.     ANI    3FH        ;
  319.     ORI    80H        ; Make CEN: port new LST: device
  320.     MOV    E,A
  321.     MVI    C,8
  322.     CALL    BDOS        ; Use BDOS to place new IOBYTE in first
  323.                 ;   page of memory
  324. ;
  325.      DI            ; DISABLE interrupts
  326.     LHLD    INTVEC        ; Get serial port interrupt processor
  327.                 ;   address
  328.     SHLD    OLDVEC        ; Save serial port interrupt processor
  329.                 ;   address
  330.     DCX    H
  331.     DCX    H
  332.     DCX    H        ; HL = next interrupt processor address
  333.     SHLD    INTVEC        ; Now have first interrupt processor
  334.                 ;   rather than second
  335. ;
  336. ;
  337. ; Initialize the interrupt vector system
  338. ;
  339.     LHLD    BIOS        ; Find start of BIOS
  340.     MVI    L,3CH        ; Displacement of baud rate byte from
  341.                 ;   start of BIOS
  342.     STA    OLDBAUD        ; Save original baud rate byte
  343. ;
  344.     MVI    L,3BH        ; Displacement of 8251 mode byte from
  345.                 ;   start of bios
  346.     MOV    A,M        ; Old mode byte set by ROM is 2sb, no
  347.                 ;   parity, 8db, x16 clock
  348.     STA    OLDMODE        ; Save original 8251 mode byte
  349. ;
  350.     MOV    B,L
  351.     MVI    A,MDSET1    ; 1 sb, np, 8 db, x16 clock mode byte
  352.     CALL    IORESET        ; Use extended bios jump to reset 8251
  353.     MVI    A,MDCOM        ; RTS, DTR, Txd, Rxd on
  354.     OUT    31H        ; Send it to 8251 control port
  355.     MVI    A,3        ; Select 8155 port C
  356.     OUT    21H        ;
  357.     IN    28H        ; Get miscellaneous information byte
  358.     STA    OLDMSC        ; Save miscellaneous information byte
  359. ;
  360. ;
  361. ; Disable ring detect interrupt, Rxd interrupt, Txd
  362. ;
  363.     ORI    0FH
  364.     MOV    E,A        ; Interrupt, enable internal clock
  365.     MVI    A,3
  366.     OUT    21H        ; Select 8155 port C
  367.     MOV    A,E
  368.     OUT    28H        ; Send new control byte to 8155 port c
  369.      EI            ; RESTORE interrupts
  370. ;
  371. ;
  372. ; Set requested baudrate then finished with initialization
  373. ;
  374.     LDA    MSPEED        ; Get the selected value
  375.     CPI    1        ; 300 bps
  376.     JZ    OK300
  377.     CPI    5        ; 1200 bps
  378.     JZ    OK1200
  379.     CPI    6        ; 2400 bps
  380.     JZ    OK2400
  381.     CPI    8        ; 9600 bps
  382.     JZ    OK9600
  383.     CPI    9        ; 19200 bps
  384.     JZ    OK19200
  385.     JMP    STUPR1        ; Else ask what is wanted
  386. ;.....
  387. ;
  388. ;
  389. ;-----------------------------------------------------------------------
  390. ;
  391. ; Reset original interrupt vectors upon EXIT from program
  392. ;
  393. RSTINT:    LDA    OLDIOB        ; Get original IOBYTE
  394.     MVI    C,8
  395.     MOV    E,A        ; Use BDOS to restore original IOBYTE
  396.     CALL    BDOS
  397. ;
  398.      DI            ; DISABLE interrupts
  399.     MVI    A,15H        ; RTS, DTR off
  400.     LHLD    OLDVEC        ; Get original interrupt service address
  401.     SHLD    INTVEC        ; Restore orig interrupt service address
  402.     MVI    A,3        ; Select 8155 port C
  403.     OUT    21H
  404.     IN    28H        ; Get miscellaneous information byte for
  405.                 ;   controlling interrupt lines
  406.     ANI    030H        ; Zero the least significant four bits
  407.     MOV    E,A
  408.     LDA    OLDMSC        ; Get original misc. 8155 control byte
  409.     ANI    0FH        ; Zero the most significant four bits
  410.     ORA    E        ; Combine everything
  411.     MOV    E,A        ; Store temporarily
  412. ;
  413.     MVI    A,3
  414.     OUT    21H        ; Select 8155 port C, again
  415.     MOV    A,E        ; Store the value held in "E"
  416.     OUT    28H        ; Restore original 8155 control byte
  417.      EI            ; RESTORE interrupts
  418. ;
  419.     MVI    B,3CH
  420.     LDA    OLDBAUD        ; Restore original baud rate byte
  421.     CALL    IORESET        ; Do an 8251 reset
  422. ;
  423.     MVI    B,3BH
  424.     LDA    OLDMODE        ; Restore original mode byte
  425.     CALL    IORESET        ; Do an 8251 reset
  426.     RET
  427. ;.....
  428. ;
  429. ;
  430. IORESET:
  431. ;  SUBROUTINE WHICH EXECUTES A MASTER RESET FOR 8251.
  432. ;  8251 RESET IS A BIOS FUNCTION IN VIXEN EXTENDED BIOS
  433. ;
  434. ;    ENTRY:
  435. ;    A    =    BYTE VALUE TO BE REPLACED IN BIOS
  436. ;            (MODE BYTE OR BAUD RATE BYTE)
  437. ;
  438. ;    B    =    HEX DISPLACEMENT FROM BASE OF BIOS
  439. ;            FOR MODE BYTE OR BAUD RATE BYTE
  440. ;            (MODE BYTE = 3BH)
  441. ;            (BAUD RATE BYTE = 3CH)
  442. ;
  443. ;    EXIT:
  444. ;    NONE
  445. ;
  446.     LHLD    BIOS        ; Find base of BIOS
  447.     MOV    L,B
  448.     MOV    M,A
  449.     MVI    L,36H        ; Displacement in BIOS for 8251 reset
  450.                 ;   function
  451.     SHLD    EXTFUN
  452.     CALL    BIOSFUNC    ; Subroutine call of BIOS 8251 reset
  453.                 ;   function
  454.     RET
  455. ;.....
  456. ;
  457. OLDIOB:      DB    0        ; Orig    IOBYTE
  458. OLDMSC:      DB    0        ; Orig misc. ctl byte for 8155 port C
  459. OLDVEC:      DB    0,0        ; Orig interrupt service vector
  460. OLDMODE:  DB    1        ; Orig 8251 mode byte from BIOS
  461. OLDBAUD:  DB    1        ; Orig baud rate byte for 8251 from BIOS
  462. BIOSFUNC: DB    AJUMP        ; Absolute jump to following memory addr
  463. EXTFUN:      DB    0,0        ; Bios extended function address
  464. ;
  465. ;-----------------------------------------------------------------------
  466. ;
  467. ;
  468. STUPR:    CALL    J$CMDSPL    ; Gives us CMDBUF+6
  469.     JNC    STUPR2
  470. ;
  471. STUPR1:    CALL    J$ILPRT
  472.     DB    'Input Baud Rate (300, 1200, 2400, 9600, 19200): ',0
  473.     LXI    D,BAUDBUF    ; Point to new input buffer
  474.     CALL    J$INBUF
  475.     CALL    J$CRLF
  476.     LXI    D,BAUDBUF+2
  477. ;
  478. STUPR2:    CALL    J$INLNCP    ; Compare BAUDBUF+2 with chars. below
  479.     DB    '300',0
  480.     JNC    OK300        ; Go if got match
  481.     CALL    J$INLNCP
  482.     DB    '1200',0
  483.     JNC    OK1200
  484.     CALL    J$INLNCP
  485.     DB    '2400',0
  486.     JNC    OK2400
  487.     CALL    J$INLNCP
  488.     DB    '9600',0
  489.     JNC    OK9600
  490.     CALL    J$INLNCP
  491.     DB    '19200',0
  492.     JNC    OK19200
  493.     CALL    J$ILPRT        ; All matches failed, tell operator
  494.     DB    '++ Incorrect entry ++',CR,LF,BELL,CR,LF,0
  495.     JMP    STUPR1        ; Try again
  496. ;
  497. OK300:    MVI    A,1        ; MSPEED 300 baud value
  498.     MVI    B,BD300        ; Get 300 baud parameters in 'HL'
  499.     JMP    LOADBD        ; Go load them
  500. ;
  501. OK1200:    MVI    A,5
  502.     MVI    B,BD1200
  503.     JMP    LOADBD
  504. ;
  505. OK2400:    XRA    A
  506.     STA    MANUAL        ; Reset to maximum auto-speed
  507.     MVI    A,6
  508.     MVI    B,BD2400
  509.     JMP    LOADBD
  510. ;
  511. OK9600:    MVI    A,8
  512.     MVI    B,BD9600
  513.     JMP    LOADBD
  514. ;
  515. OK19200:MVI    A,9
  516.     MVI    B,BD19200
  517. ;
  518. LOADBD:    STA    MSPEED        ; Change time-to-send to match baudrate
  519.     MOV    A,B        ; Get baudrate byte
  520.     MVI    B,3CH
  521.     JMP    IORESET        ; Used extended BIOS function to reset
  522. ;.....                ;   baud rate on 8251
  523. ;
  524. ;
  525. ; Table of baudrate parameters
  526. ;
  527. ; Baudrate table (16 different rates are available)
  528. ;
  529. BD300    EQU    6        ; 300 baud
  530. BD1200    EQU    8        ; 1200 bps
  531. BD2400    EQU    11        ; 2400 bps
  532. BD4800    EQU    13        ; 4800 bps
  533. BD9600    EQU    15        ; 9600 bps
  534. BD19200    EQU    16        ; 19200 bps
  535. ;
  536. BAUDBUF:DB    10,0,0,0,0,0
  537.     DB    0,0,0,0,0,0
  538. ;
  539. ;                   end
  540. ;-----------------------------------------------------------------------
  541. ;
  542. ; NOTE: Must terminate by 0400H
  543. ;
  544.     END
  545.