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 / BSTAM / UIOPRTS3.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  17KB  |  717 lines

  1. ;----------------------------------------------------------
  2. ; UIOPRTS3  BSTAM Personality Module Version 4.6   10-28-83
  3. ;
  4. ; Prepared by:     Adams and Hamilton, Inc.
  5. ;                         PO Box 932
  6. ;                 Kalamazoo, Michigan  49009
  7. ;                       (616) 342-0335
  8. ;
  9. ;    Routines are provided for the following devices;
  10. ;
  11. ;    California Computer Systems 2710    *
  12. ;    Heath/Zenith H-8 or H/Z-89/90        *
  13. ;    Heath/Zenith 100 Computer  <8085 CPU>   *
  14. ;      IMSAI SIO-2 (S-100) I/O Board        fixed BR
  15. ;    Morrow Design Decision or Multi/IO    *
  16. ;    North Star Horizon Computer        fixed BR
  17. ;    North Star HSIO-4 (S-100) IOB        *
  18. ;    Ohio Scientific C3 Computer        fixed BR
  19. ;    Sanyo MBC-1000 Computer            fixed BR
  20. ;
  21. ;    NOTE: "*" indicates software selectable I/O device
  22. ;
  23. ;----------------------------------------------------------
  24. ;Note:    Should you locate any bugs in these routines please
  25. ;       contact us rather than publishing your modification.
  26. ;----------------------------------------------------------
  27. no    equ    0    ;no  = false
  28. yes    equ    not no    ;yes = true
  29. ;==========================================================
  30. ; To install this I/O module all you need do is set your
  31. ; equate to 'yes' (ALL others should be set to 'no').
  32. ;==========================================================
  33. ccs    equ    no    ;CCS 2710 IO Board
  34. hz89    equ    no    ;Heath/Zenith 89  Computer
  35. z100    equ    no    ;Heath Zenith 100 Computer
  36. horz    equ    no    ;North Star Horizon Computer
  37. hsio    equ    no    ;North Star HSIO-4 I/O Board
  38. imsi    equ    no    ;IMSAI SIO 2 I/O Board
  39. dec1    equ    no    ;Morrow Decision or Multi/IO Board
  40. osic3    equ    no    ;Ohio Scientific C3 Computer
  41. snyo    equ    no    ;Sanyo MBC-1000 Computer
  42. ;
  43. ;==========================================================
  44. ; Port Equates -- Alter ONLY if your hardware differs
  45. ;==========================================================
  46.     if    ccs
  47. data    equ    78h    ;Port D (Board base = 10h)
  48.     endif    ;ccs
  49. ;
  50.     if    hz89
  51. data    equ    0d8h    ;Port 330Q
  52.     endif    ;hz89
  53. ;
  54.     if    z100
  55. data    equ    0edh    ;Data   Port
  56. stat    equ    0ech    ;Status Port
  57.     endif    ;z100
  58. ;
  59.     if    dec1
  60. data    equ    48h    ;all IO ports base address
  61. dev    equ    2    ;Serial Port 2
  62.     endif    ;dec1
  63. ;
  64.     if    imsi or horz
  65. data    equ    04h    ;data i/o port
  66. stat    equ    data+1    ;status port
  67.     endif    ;imsi or horz
  68. ;
  69.     if    hsio
  70. base    equ    10h    ;address of HSIO-4 board
  71. port    equ    0ch    ;address of Port D
  72. addr    equ    base+port
  73. baud    equ    addr+0    ;baud port
  74. intr    equ    addr+1    ;interrupt port (not used here)
  75. data    equ    addr+2    ;data i/o port
  76. stat    equ    addr+3    ;status port
  77.     endif    ;hsio
  78. ;
  79.     if    osic3
  80. data    equ    0af03h    ;data port
  81. stat    equ    data-1    ;status port
  82.     endif    ;osic3
  83. ;
  84.     if    snyo
  85. data    equ    0a4h    ;data i/o port
  86. stat    equ    data+1    ;status port
  87.     endif    ;snyo
  88. ;
  89. ;==========================================================
  90. ;==========================================================
  91. ; Code starts here - There should be no reason to modify
  92. ; or change any routines below this line.
  93. ;==========================================================
  94. ;==========================================================
  95. ; Jump Table (Do NOT Alter)
  96. ;
  97.     org    103h
  98. initil    jmp    initiu    ;initialization  routine
  99. insport jmp    inspru    ;status port     routine
  100. errset    jmp    errstu    ;error reset     routine
  101. inport    jmp    inprtu    ;read data port  routine
  102. outport jmp    outpru    ;write data port routine
  103. usertne    jmp    useru    ;user-defined    routine
  104. ;----------------------------------------------------------
  105. ; REMEMBER: All I/O devices should be made to 'look' like
  106. ;           an INTEL 8251 chip. BSTAM assumes that device
  107. ;           is being used in all installations.
  108. ;----------------------------------------------------------
  109. ;    This is the initialization routine. To be
  110. ;    compatible with most BSTAM users, use the
  111. ;    following initialization guide lines:
  112. ;
  113. ;    1. use 1 stop bit        (optional - 2)
  114. ;    2. use 8 data bits        (must)
  115. ;    3. use 1 start bit        (must)
  116. ;    4. use 16x for clock rate    (must)
  117. ;    5. use asynchronous mode only    (must)
  118. ;
  119. initiu: call    signon    ;tell version number to user
  120. ;
  121.     if    dec1
  122.     call    fprep    ;get PIC addr & prepare the io port
  123.     endif    ;dec1
  124. ;
  125. ;------------------------
  126.     lxi    h,6dh    ;
  127.     mov    a,m    ;and move from memory
  128.     cpi    '/'    ;is an option specified?
  129.     jnz    ninit    ;if not then bypass initialization
  130. ;
  131.     if    horz or imsi or osic3 or snyo
  132.     call    print    ;these devices are FIXED BAUD RATE
  133.     db    '(Initialization was performed on port)'
  134.     db    13,10,0    ;
  135.     jmp    prtset    ;make sure we don't go elsewhere
  136.     endif    ;horz or imsi or osic3 or snyo
  137. ;
  138.     if    ccs or hz89 or hsio or z100 or dec1 
  139.     call    print    ;announce initialization
  140.     db    '(Word Set to: 8d, 1S, NP  Baud: ',0
  141.     inx    h    ;point to option byte
  142.     mov    a,m    ;move from memory
  143.     ani    7fh    ;strip away parity bit
  144.     cpi    '1'    ;is it a '110', '1200' or '19.2k'?
  145.     jz    hilo1    ;if yes, then go find out
  146.     cpi    '3'    ;is it a '300' or '38.4k'?
  147.     jz    hilo3    ;if yes, then go find out
  148.     cpi    '4'    ;is it a '450' or '4800'?
  149.     jz    hilo4    ;if yes, then go find out
  150.     cpi    '6'    ;is it a '600'?
  151.     jz    check6    ;if yes, then double check
  152.     cpi    '2'    ;is it a '2400'?
  153.     jz    check2    ;if yes, then double check
  154.     cpi    '9'    ;is it a '9600'?
  155.     jz    check9    ;if yes, then double check
  156.     jmp    error    ;bail out of BSTAM
  157. ;------------------------
  158. hilo1:    inx    h    ;get second character 
  159.     mov    a,m    ;move from memory to a
  160.     ani    7fh    ;strip away parity bit
  161.     cpi    '1'    ;ahah, so it's (ughhh) '110' baud
  162.     jz    init11    ;set to 110 baud
  163.     cpi    '2'    ;so he likes to talk 212
  164.     jz    init12    ;set to 1200 baud
  165.     cpi    '9'    ;guess the man crosstalks 'puter's
  166.     jz    init19    ;set to 19.2k baud
  167.     jmp    error    ;bail out of BSTAM
  168. ;
  169. hilo3:    inx    h    ;get second character
  170.     mov    a,m    ;move from memory to a
  171.     ani    7fh    ;strip away parity bit
  172.     cpi    '0'    ;he wants to talk 103
  173.     jz    init30    ;set to 300 baud
  174.     cpi    '8'    ;a real fast talker
  175.     jz    init38    ;set to 38.4k baud
  176.     jmp    error    ;bail out of BSTAM
  177. ;
  178. hilo4:    inx    h    ;get second character
  179.     mov    a,m    ;move from memory to a
  180.     ani    7fh    ;strip away parity bit
  181.     cpi    '5'    ;so he wants to speed up 103 modems
  182.     jz    init45    ;set to 450 baud
  183.     cpi    '8'    ;we've got 'puters talking
  184.     jz    init48    ;set to 4800 baud
  185.     jmp    error    ;bail out of BSTAM
  186. ;------------------------
  187. check2:    inx    h    ;get second character
  188.     mov    a,m    ;move from memory to a
  189.     ani    7fh    ;strip away parity bit
  190.     cpi    '4'    ;now we're sure he wants 2400
  191.     jz    init24    ;set to 2.4k baud
  192.     jmp    error    ;bail out of BSTAM
  193. ;
  194. check6:    inx    h    ;get second character
  195.     mov    a,m    ;move from memory to a
  196.     ani    7fh    ;strip away parity bit
  197.     cpi    '0'    ;now we're sure he wants 600
  198.     jz    init60    ;set to 600  baud
  199.     jmp    error    ;bail out of BSTAM
  200. ;
  201. check9:    inx    h    ;get second character
  202.     mov    a,m    ;move from memory to a
  203.     ani    7fh    ;strip away parity bit
  204.     cpi    '6'    ;now we're sure he wants 9600
  205.     jz    init96    ;set to 9600 baud
  206.     jmp    error    ;bail out of BSTAM
  207. ;------------------------
  208. init11:    call    print    ;
  209.     db    '  110)',13,10,0
  210. ;
  211.     if    ccs or hz89 or dec1
  212.     push    h    ;save hl
  213.     lxi    h,1087    ;load  110 baud
  214.     endif    ;ccs or hz89 or dec1
  215. ;
  216.     if    hsio    
  217.     mvi    a,7    ;
  218.     out    baud    ;
  219.     endif    ;hsio
  220. ;
  221.     jmp    iostrt    ;reset & rearm I/O
  222. ;
  223. init30:    call    print    ;
  224.     db    '  300)',13,10,0
  225. ;
  226.     if    ccs or hz89 or dec1
  227.     push    h    ;save hl
  228.     lxi    h,384    ;load  300 baud
  229.     endif    ;ccs or hz89 or dec1
  230. ;
  231.     if    hsio
  232.     mvi    a,6    ;
  233.     out    baud    ;
  234.     endif    ;hsio
  235. ;
  236.     jmp    iostrt    ;reset & rearm I/O
  237. ;
  238. init45:    if    ccs or hz89 or dec1
  239.     call    print    ;
  240.     db    '  450)',13,10,0
  241.     push    h    ;save hl
  242.     lxi    h,256    ;load  450 baud
  243.     endif    ;ccs or hz89 or dec1
  244. ;
  245.     if    hsio
  246.     jmp    error    ;no such BR on HSIO-4
  247.     endif    ;hsio
  248. ;
  249.     jmp    iostrt    ;reset & rearm I/O
  250. ;
  251. init60:    call    print    ;
  252.     db    '  600)',13,10,0
  253. ;
  254.     if    ccs or hz89 or dec1
  255.     push    h    ;save hl
  256.     lxi    h,192    ;load  600 baud
  257.     endif    ;ccs or hz89 or dec1
  258. ;
  259.     if    hsio
  260.     mvi    a,5    ;
  261.     out    baud    ;
  262.     endif    ;hsio
  263. ;
  264.     jmp    iostrt    ;reset & rearm I/O
  265. ;
  266. init12:    call    print    ;
  267.     db    ' 1.2k)',13,10,0
  268. ;
  269.     if    ccs or hz89 or dec1
  270.     if    bell212
  271. ;
  272. ; If you are using a Bell 212-A Modem (or something that
  273. ; thinks that it is) you may set its internal switches so
  274. ; that it will respond to a harware signal and automatically
  275. ; enter 1200 baud operation. In the Morrow Decision I, as it
  276. ; does not support RS-232 PIN 23 we strap PIN 23 to PIN 5 &
  277. ; turn on RTS which produces a compatible signal. If you are
  278. ; using an 8250 the following code will do the trick. Other-
  279. ; wise please fudge accordingly.
  280. ;
  281.     mvi    a,3    ;fudge up a 212 'HI' signal by turn-
  282.     call    prep    ;ing on RTS (5) and strapping to (23)
  283.     out    data+4    ;on the RS-232 for automatice 1200 bd
  284.             ;operation.
  285.     endif    bell212
  286. ;
  287.     push    h    ;save hl
  288.     lxi    h,96    ;load 1200 baud
  289.     endif    ;ccs or hz89 or dec1
  290. ;
  291.     if    hsio
  292.     mvi    a,4    ;
  293.     out    baud    ;
  294.     endif    ;hsio
  295. ;
  296.     jmp    iostrt    ;reset & rearm I/O
  297. ;
  298. init24:    call    print    ;
  299.     db    ' 2.4k)',13,10,0
  300. ;
  301.     if    ccs or hz89 or dec1
  302.     push    h    ;save hl
  303.     lxi    h,48    ;load 2400 baud
  304.     endif    ;ccs or hz89 or dec1
  305. ;
  306.     if    hsio
  307.     mvi    a,3    ;
  308.     out    baud    ;
  309.     endif    ;hsio
  310. ;
  311.     jmp    iostrt    ;reset & rearm I/O
  312. ;
  313. init48:    call    print    ;
  314.     db    ' 4.8k)',13,10,0
  315. ;
  316.     if    ccs or hz89 or dec1
  317.     push    h    ;save hl
  318.     lxi    h,24    ;load 4800 baud
  319.     endif    ;ccs or hz89 or dec1
  320. ;
  321.     if    hsio
  322.     mvi    a,2    ;
  323.     out    baud    ;
  324.     endif    ;hsio
  325. ;
  326.     jmp    iostrt    ;reset & rearm I/O
  327. ;
  328. init96:    call    print    ;
  329.     db    ' 9.6k)',13,10,0
  330. ;
  331.     if    ccs or hz89 or dec1
  332.     push    h    ;save hl
  333.     lxi    h,12    ;load 9600 baud
  334.     endif    ;ccs or hz89 or dec1
  335. ;
  336.     if    hsio
  337.     mvi    a,1    ;
  338.     out    baud    ;
  339.     endif    ;hsio
  340. ;
  341.     jmp    iostrt    ;reset & rearm I/O
  342. ;
  343. init19:    call    print    ;
  344.     db    '19.2k)',13,10,0
  345. ;
  346.     if    ccs or hz89 or dec1
  347.     push    h    ;save hl
  348.     lxi    h,6    ;load 19.2k baud
  349.     endif    ;ccs or hz89 or dec1
  350. ;
  351.     if    hsio
  352.     mvi    a,0    ;
  353.     out    baud    ;
  354.     endif    ;hsio
  355. ;
  356.     jmp    iostrt    ;reset & rearm I/O
  357. ;
  358. init38:    if    ccs or hz89 or dec1
  359.     call    print    ;
  360.     db    '38.4k)',13,10,0
  361.     push    h    ;save hl
  362.     lxi    h,3    ;load 38.4k baud
  363.     endif    ;ccs or hz89 or dec1
  364. ;
  365.     if    hsio
  366.     jmp    error    ;no such BR on HSIO-4
  367.     endif    ;hsio
  368. ;------------------------
  369. iostrt:    if    dec1
  370.     call    prep    ;inform the pic
  371.     endif    ;dec1
  372. ;
  373.     if    ccs or hz89 or dec1
  374.     mvi    a,83h    ;
  375.     out    data+3    ;
  376.     mov    a,l    ;
  377.     out    data+0    ;
  378.     mov    a,h    ;
  379.     out    data+1    ;
  380.     mvi    a,3    ;
  381.     out    data+3    ;
  382.     mvi    a,1    ;
  383.     out    data+4    ;
  384.     pop    h    ;restore hl
  385.     ret        ;return to BSTAM
  386.     endif    ;ccs or hz89 or dec1
  387. ;
  388.     if    hsio
  389.     push    b     ;save bc
  390.     push    h    ;save hl
  391.     lxi    h,inits    ;point to commands
  392.     mvi    b,5    ;number of commands to be issued
  393. ;
  394. initlp:    mov    a,m    ;move command to Reg A
  395.     inx    h    ;increment the pointer
  396.     call    statlp    ;send it to the 8251    
  397.     dcr    b    ;decrement the counter
  398.     jnz    initlp    ;loop until B=0
  399.     in    data    ;gobble up garbage
  400.     in    data    ;gobble up garbage
  401.     pop    h    ;restore hl    
  402.     pop    b    ;restore bc
  403.     ret        ;return to BSTAM
  404. ;
  405. statlp:    out    stat    ;send it to the 8251
  406.     nop        ;
  407.     nop        ;
  408.     nop        ;
  409.     nop        ;
  410.     nop        ;
  411.     nop        ;
  412.     ret        ;return to routine
  413. ;
  414. inits:    db    03h,03h,40h,4eh,37h
  415.     endif    ;hsio
  416. ;
  417.     endif    ;ccs or hz89 or hsio or z100 or dec1
  418. ;------------------------
  419.     if    horz or imsi or snyo
  420. prtset:    push    b     ;save bc
  421.     push    h    ;save hl
  422.     lxi    h,inits    ;point to commands
  423.     endif    ;horz or imsi or snyo
  424. ;
  425.     if    horz or imsi
  426.     mvi    b,5    ;number of commands to be issued
  427.     endif    ;horz or imsi
  428. ;
  429.     if    snyo
  430.     mvi    b,3    ;number of commands to be issued
  431.     endif    ;snyo
  432. ;
  433.     if    horz or imsi or snyo
  434. initlp:    mov    a,m    ;move command to Reg A
  435.     inx    h    ;increment the pointer
  436.     call    statlp    ;send it to the 8251    
  437.     dcr    b    ;decrement the counter
  438.     jnz    initlp    ;loop until B=0
  439.     endif    ;horz or imsi or snyo
  440. ;
  441.     if    horz or imsi
  442.     in    data    ;gobble up garbage
  443.     in    data    ;gobble up garbage
  444.     endif    ;horz or imsi
  445. ;
  446.     if    horz or imsi or snyo
  447.     pop    h    ;restore hl    
  448.     pop    b    ;restore bc
  449.     ret        ;return to BSTAM
  450. ;
  451. statlp:    out    stat    ;send it to the 8251
  452.     nop        ;
  453.     nop        ;
  454.     nop        ;
  455.     nop        ;
  456.     nop        ;
  457.     nop        ;
  458.     ret        ;return to routine
  459.     endif    ;horz or imsi or snyo
  460. ;
  461.     if    horz or imsi
  462. inits:    db    03h,03h,40h,4eh,37h
  463.     endif    ;horz or imsi
  464. ;
  465.     if    snyo
  466. inits:    db    40h,4eh,37h
  467.     endif    ;snyo
  468. ;
  469.     if    osic3
  470. prtset:    mvi    a,0    ;blank out register a
  471.     nop        ;
  472.     nop        ;
  473.     nop        ;screw around a while
  474.     mvi    a,03h    ;
  475.     sta    stat    ;send it to the 6850
  476.     mvi    a,51h    ;
  477.     sta    stat    ;send it to the 6850
  478.     endif    ;osic3
  479. ;
  480.     ret        ;return to BSTAM 
  481. ;
  482. ;----------------------------------------------------------
  483. ;    This is the status read port routine.
  484. ;    When exiting this routine, BSTAM expects
  485. ;    the following bits to be set in Register A,
  486. ;    if needed:
  487. ;
  488. ;    1. 20 bit set if framing error
  489. ;    2. 10 bit set if overrun error
  490. ;    3. 08 bit set if parity  error
  491. ;    4. 04 bit set if transmitter empty 
  492. ;    5. 02 bit set if receiver ready
  493. ;    6. 01 bit set if transmitter ready 
  494. ;    7. do not set the 80 bit or 40 bit
  495. ;
  496. ;
  497. inspru:    if    dec1
  498.     call    prep    ;prepare the io
  499.     endif    ;dec1
  500. ;
  501.     if    horz or hsio or z100 or imsi or snyo
  502.     in    stat    ;input status port
  503.     endif    ;horz or hsio or z100 or imsi or snyo
  504. ;
  505.     if    ccs or hz89 or dec1
  506.     in    data+5    ;
  507.     ani    21h    ;
  508.     push    b    ;save bc
  509.     rlc        ;
  510.     mov    b,a    ;save it
  511.     rlc        ;
  512.     rlc        ;
  513.     ora    b    ;
  514.     pop    b    ;restore bc
  515.     ani    3    ;
  516.     ori    4    ;
  517.     endif    ;ccs or hz89 or dec1
  518. ;
  519.     if    osic3
  520.     push    b    ;save bc
  521.     lda    stat    ;get status
  522.     mov    b,a    ;and tuck it away
  523.     ani    2    ;isolate rxrdy
  524.     rar        ;
  525.     mov    c,a    ;save rxrdy
  526.     mov    a,b    ;untuck it
  527.     ani    1    ;isolate txrdy
  528.     ral        ;rotate left
  529.     ora    c    ;add it back
  530.     pop    b    ;restore bc
  531.     endif    ;osic3
  532. ;
  533.     ret        ;return to BSTAM
  534. ;
  535. ;----------------------------------------------------------
  536. ; This is the error reset routine. OSI does NOT reset 6850.
  537. ;
  538. errstu: if    dec1
  539.     call    prep    ;
  540.     endif    ;dec1
  541. ;
  542.     if    horz or hsio or z100 or imsi or snyo
  543.     mvi    a,37h    ;reset fe, pe & oe
  544.     out    stat    ;send it to 8251
  545.     endif    ;horz or hsio or z100
  546.         ;imsi or snyo
  547. ;
  548.     ret        ;return to BSTAM
  549. ;
  550. ;----------------------------------------------------------
  551. ;    This is the read data port routine.
  552. ;    Before this routine is entered, the 02 bit of
  553. ;    the status read routine must have been set.
  554. ;    Do not clear the 80 bit from the data input port.
  555. ;    Return with Register A loaded with input data.
  556. ;
  557. inprtu: if    not osic3
  558.     if    dec1
  559.     call    prep    ;prepare the io
  560.     endif    ;dec1
  561. ;
  562.     in    data    ;get data from port
  563.     endif    ;not osic3
  564. ;
  565.     if    osic3
  566.     lda    data
  567.     endif    ;osic3
  568. ;
  569.     ret        ;return to BSTAM
  570. ;
  571. ;----------------------------------------------------------
  572. ;    This is the write data port routine.
  573. ;    Before this routine is entered, the 04 bit & 01 bit
  574. ;    of status read must be set.
  575. ;
  576. ;    Do not clear the 80 bit from the data output port.
  577. ;    Register A contains the output data.
  578. ;
  579. outpru: if    not osic3
  580.     if    dec1
  581.     call    prep    ;prepare the io
  582.     endif    ;dec1
  583. ;
  584.     out    data    ;send data to remote cpu
  585.     endif    ;not osic3
  586. ;
  587.     if    osic3
  588.     sta    data
  589.     endif    ;osic3
  590. ;
  591.     ret        ;return to BSTAM
  592. ;
  593. ;----------------------------------------------------------
  594. ;    This is the device driver signon routine
  595. ;
  596. signon: call    print
  597.     db    13,10,10,7
  598.     db    'Adams and Hamilton, Inc. Kalamazoo, MI'
  599.     db    13,10
  600. ;
  601.     if    ccs
  602.     db    'CCS 2710        Port D   '
  603.     endif    ;ccs
  604. ;
  605.     if    hz89
  606.     db    'Heath/Zenith 8 or 89/90  '
  607.     endif    ;hz89
  608. ;
  609.     if    z100
  610.     db    'Zenith 100 <8085 CPU>    '
  611.     endif    ;z100
  612. ;
  613.     if    horz
  614.     db    'North Star Horizon   '
  615.     endif    ;horz
  616. ;
  617.     if    hsio
  618.     db    'North Star HSIO-4        '
  619.     endif    ;hsio
  620. ;
  621.     if    imsi
  622.     db    'Imsai SIO-2  Port B  '
  623.     endif    ;imsi
  624. ;
  625.     if    dec1
  626.     db    'Morrow Design Multi/IO   '
  627.     endif    ;dec1
  628. ;
  629.     if    osic3
  630.     db    'Ohio Scientific C3   '
  631.     endif    ;osic3
  632. ;
  633.     if    snyo
  634.     db    'Sanyo MBC-1000       '
  635.     endif    ;snyo
  636. ;
  637.     if    ccs or hz89 or dec1
  638.     db    '(110-38.4 kb)'
  639.     endif    ;ccs or hz89 or dec1
  640. ;
  641.     if    hsio or z100
  642.     db    '(110-19.2 kB)'
  643.     endif    ;hsio or z100
  644. ;
  645.     if    imsi or horz or osic3 or snyo
  646.     db    '(Fixed Baud Rate)'
  647.     endif    ;imsi or horz or osic3 or snyo
  648. ;
  649.     db    13,10,0
  650.     ret        ;return to routine
  651. ;
  652. print:    xthl        ;
  653.     push    b    ;
  654.     push    d    ;
  655. ;
  656. ploop:    mov    e,m    ;move from ram
  657.     inx    h    ;increment the count
  658.     mvi    a,0    ;let's see if we're
  659.     cmp    e    ;at the end?
  660.     jz    pend    ;bail out if so
  661.     push    h    ;else save hl
  662.     mvi    c,6    ;and do..
  663.     call    5    ;.. a print
  664.     pop    h    ;restore hl
  665.     jmp    ploop    ;loop until '0' is encountered
  666. ;
  667. pend:    pop    d    ;
  668.     pop     b    ;restore it all
  669.     xthl        ;
  670.     ret
  671. ;
  672. ninit:    call    print    ;
  673.     db    13,13    ;
  674.     db    '(No initialization performed by BSTAM)'
  675.     db    13,10,0
  676.     ret        ;return to BSTAM
  677. ;
  678. error:    call    print    ;
  679.     db    'ERROR)',13,10,13,10,7
  680.     db    '*** BAUD RATE ERROR - PROGRAM ABORTING '
  681.     db    '***',13,10,7,0
  682.     jmp    0    ;bail out of BSTAM
  683. ;
  684. ;----------------------------------------------------------
  685. ;    This is the io preparation area for Morrow & God-
  686. ;       bout I/O Boards (S-100)
  687. ;
  688.     if    dec1
  689. fprep:    push    d    ;save de
  690.     push    h    ;save hl
  691.     lhld    1    ;point to wboot addr
  692.     lxi    d,37h    ;offset for PIC
  693.     dad    d    ;add 'em together
  694.     shld    grpad    ;store 'em
  695.     pop    h    ;restore hl
  696.     pop    d    ;restore de
  697. ;
  698. prep:    push    h    ;save hl
  699.     push    psw    ;save psw
  700.     lhld    grpad    ;get the group address
  701.     mov    a,m    ;move it to Register A
  702.     ori    dev    ;Serial Port P2
  703.     out    data+7    ;inform I/O board
  704.     pop    psw    ;restore psw
  705.     pop    h    ;restore hl
  706.     ret        ;return to routine
  707. ;
  708. grpad:    ds    2    ;PIC address stored here
  709.     endif        ;dec1
  710. ;
  711. ;----------------------------------------------------------
  712. useru:    ret        ;return to BSTAM
  713. ;----------------------------------------------------------
  714.     end
  715.  
  716.  
  717.