AK6DN
Veteran Member
Here's a simple non interrupt driven cross port (TTY rx to TU58 tx, TU58 rx to TTY tx) echo program. You only need to deposit locations 2010 thru 2126, and then start at 2010.
This program assumes the rx/tx baud rates are the same on both cards, and it will not detect or handle an occasional character overrun (ie there is only one character of buffer in each direction). If you are just typing characters by hand to each port this is sufficient, but if you are blasting characters at maximal rate (eg, by using a PC to send text as fast as possible) then characters may get dropped.
As far as using vectored interrupts this simple program could be extended to do that without too much effort, but the overflow limitation would still be an issue. Solving that would mean implementing multi-character buffers in each direction, and some type of flow control (like XON/XOFF). As they say that would be left as an exercise for the reader ...
Don
FYI here is the source file:
This program assumes the rx/tx baud rates are the same on both cards, and it will not detect or handle an occasional character overrun (ie there is only one character of buffer in each direction). If you are just typing characters by hand to each port this is sufficient, but if you are blasting characters at maximal rate (eg, by using a PC to send text as fast as possible) then characters may get dropped.
As far as using vectored interrupts this simple program could be extended to do that without too much effort, but the overflow limitation would still be an issue. Solving that would mean implementing multi-character buffers in each direction, and some type of flow control (like XON/XOFF). As they say that would be left as an exercise for the reader ...
Don
Code:
1 .title DL11 Tester
2
3 .sbttl DL11 definitions
4
5 177560 ttbase =177560
6 176500 dlbase =176500
7
8 000000 rcsr =0
9 000002 rbuf =2
10 000004 tcsr =4
11 000006 tbuf =6
12
13 .sbttl low memory
14
15 .enabl ama ; change all mode 67 references to 37
16 .asect ; absolute load image
17
18 .=200
19 000200 000137 002010 jmp @#start ; standard diagnostic entry
20
21 .sbttl global variables
22
23 .=2000
24 stack: .blkw 4 ; top of stack plus some space
25
26 .sbttl program start
27
28 002010 012706 002000 start: mov #stack,sp ; setup a stack
29 002014 000005 reset ; reset the world
30
31 002016 005000 clr r0 ; clear TTY flag and char
32 002020 005001 clr r1 ; clear TU58 flag and char
33 002022 012702 100000 mov #100000,r2 ; bit15 flag set plus zeroes
34 002026 012704 177560 mov #ttbase,r4 ; console DL11 base
35 002032 012705 176500 mov #dlbase,r5 ; TU58 DL11 base
36
37 002036 105764 000000 loop: tstb rcsr(r4) ; check TTY rcv char done
38 002042 100003 bpl 10$ ; br if none
39 002044 010200 mov r2,r0 ; set rcv flag <15>
40 002046 156400 000002 bisb rbuf(r4),r0 ; yes, get the char, clr rcv char done
41
42 002052 105765 000000 10$: tstb rcsr(r5) ; check TU58 rcv char done
43 002056 100003 bpl 20$ ; br if none
44 002060 010201 mov r2,r1 ; set rcv flag <15>
45 002062 156501 000002 bisb rbuf(r5),r1 ; yes, get the char, clr rcv char done
46
47 002066 005700 20$: tst r0 ; check char avail to xmt
48 002070 100006 bpl 30$ ; br if not
49 002072 105765 000004 tstb tcsr(r5) ; check TU58 xmt char ready
50 002076 100003 bpl 30$ ; br if not ready
51 002100 110065 000006 movb r0,tbuf(r5) ; yes, sent TTY char to TU58
52 002104 005000 clr r0 ; clear flag and char
53
54 002106 005701 30$: tst r1 ; check char avail to xmt
55 002110 100006 bpl 40$ ; br if not
56 002112 105764 000004 tstb tcsr(r4) ; check TTY xmt char ready
57 002116 100003 bpl 40$ ; br if not ready
58 002120 110164 000006 movb r1,tbuf(r4) ; yes, send TU58 char to TTY
59 002124 005001 clr r1 ; clear flag and char
60
61 002126 000743 40$: br loop ; back to top
62
63 .end
FYI here is the source file:
Code:
.title DL11 Tester
.sbttl DL11 definitions
ttbase =177560
dlbase =176500
rcsr =0
rbuf =2
tcsr =4
tbuf =6
.sbttl low memory
.enabl ama ; change all mode 67 references to 37
.asect ; absolute load image
.=200
jmp @#start ; standard diagnostic entry
.sbttl global variables
.=2000
stack: .blkw 4 ; top of stack plus some space
.sbttl program start
start: mov #stack,sp ; setup a stack
reset ; reset the world
clr r0 ; clear TTY flag and char
clr r1 ; clear TU58 flag and char
mov #100000,r2 ; bit15 flag set plus zeroes
mov #ttbase,r4 ; console DL11 base
mov #dlbase,r5 ; TU58 DL11 base
loop: tstb rcsr(r4) ; check TTY rcv char done
bpl 10$ ; br if none
mov r2,r0 ; set rcv flag <15>
bisb rbuf(r4),r0 ; yes, get the char, clr rcv char done
10$: tstb rcsr(r5) ; check TU58 rcv char done
bpl 20$ ; br if none
mov r2,r1 ; set rcv flag <15>
bisb rbuf(r5),r1 ; yes, get the char, clr rcv char done
20$: tst r0 ; check char avail to xmt
bpl 30$ ; br if not
tstb tcsr(r5) ; check TU58 xmt char ready
bpl 30$ ; br if not ready
movb r0,tbuf(r5) ; yes, sent TTY char to TU58
clr r0 ; clear flag and char
30$: tst r1 ; check char avail to xmt
bpl 40$ ; br if not
tstb tcsr(r4) ; check TTY xmt char ready
bpl 40$ ; br if not ready
movb r1,tbuf(r4) ; yes, send TU58 char to TTY
clr r1 ; clear flag and char
40$: br loop ; back to top
.end
Last edited: