; Crosstalk/S i/o drivers for North Star Horizon computer ; with HSIO-4 board - modem on port D, 300 baud. ; NOTE: When using CROSSTALK with TSS/C, the modem port ; interrupts MUST be disabled - see fig. 3-27 in the ; HSIO-4 manual for details. ; parameters for HSIO-4 : base equ 10h ;base address of HSIO board porta equ base ;port a offset from base portb equ base+4 ;port b " " portc equ base+8 ;port c " " portd equ base+12 ;port d " " baudr equ 6 ;set port for 300 baud baud equ 0 ;baud rate port position madk equ 1 ;interrupt mask port position udat equ 2 ;usart data port position usta equ 3 ;usart status port position port equ portd ;use port D for modem status equ port+usta ;status port location data equ port+udat ;data port location org 100h jmp init ; go initialize port org 110h sstat: in status ; get port d status ani 2 ; mask input status bit ret ; and return org 120h sin: in status ; get port d status ani 2 ; char. waiting ? jz sin ; no, loop until ready in data ; get character into acc. ret ; go home with it org 130h sout: push psw ; save char. on stack sout1: in status ; get port d status ani 1 ; mask output status bit jz sout1 ; loop until ready pop psw ; get char. off stack out data ; send to modem ret ; that's it scar: org 140h ; this code MUST be here nop ! nop ! ret INIT: mvi a,baudr out port+baud ;set baud rate on modem port mvi a,3 ;issue RESET to usart call ustat call ustat mvi a,40h call ustat mvi A,0ceh ;set 2 stop bits, 16X clock call ustat mvi A,27h ;set DTR, RTS, TXEN, ER, and RXF call ustat in data ;clear junk from input port jmp 0200h ;jump into crosstalk program ustat: out status ret end