home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols100 / vol179 / uioprts2.asm < prev    next >
Encoding:
Assembly Source File  |  1994-07-13  |  16.5 KB  |  702 lines

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