1802ELFSimTerminal.jpg
Information on how to use the TerminalSim in your program.
The "Send Text File" button allows you to enter a program in Super Basic or any other programming which uses the Serial I/O Routines shown in the example below. You can use any valid ASCII character for the "Wait For Character". For Carriage Return and Line Feed, enter {CR} and {LF}.

In my New ELF II design, I used the 6551 Asynchronous Communication Interface Adapter for RS232 communication.
The two register select lines RS0 and RS1 of the 6551 are decoded at 8000.
The following table indicates the internal register select coding:
RS1 RS0 WRITE_NOT READ
0 0 Transmit Data Register Receive Data Register
0 1 Programmed Reset (Data is "Don't Care") Status Register
1 0 Command Register Command Register
1 1 Control Register Control Register

The table shows that only the Command and Control registers are read/write. The Programmed Reset opertion does not cause any data transfer, but is used to clear the 6551 registers. The Programmed Reset is slightly different from the Hardware Reset (pin 4) and these differences are described in the datasheet under the individual register definitions.
Even though the 4 byte address repeats from 8000 to 87FF, in the 1802ELFSim, only 4 bytes gets affected.
The following code snippet can be assembled with my Special 1802 Assembler:
; Serial I/O for Quest SUPER BASIC V 5.0
ORG 3300
C0 #BRKRTN; I/O initialization
C0 #BREAK; BREAK routine entry
C0 #OUTPUT; OUTPUT entry with data in RF.1
;
D4 #INIT; INPUT entry (must have the ASCII data in RF.1 before returning back to BASIC)
D4 #SERIALIN
D4 #RESTORE
9F D5
;
OUTPUT:D4 #INIT
9F D4 #SERIALOUT
D4 #RESTORE D5
;
; Common init for both I/O routines
INIT:9A 73 8A 73
F8 80 BA; First point to the Control Register at 8003 (Base Address + 3) to set baud rate to 19,200
F8 03 AA; then point to the Command Register at 8002 to enable Receiver/Transmitter and disable Transmit Interrupt
F8 1F 5A 2AA
F8 09 5A 2A
D5
;
; Common restore for both I/O routines
RESTORE:12
72 AA
F0 BA
D5
; Serial Output Routine
; RF.1 contains what will be sent (value is in ASCII)
SERIALOUT:2A; Point to 8000 (in this instance, the 5N instruction will access the Transmit Data Register)
9F 5A
1A; Point back to Status Register
SERIALOUTLOP2:3D @SERIALOUTLOP33
0A FA 08 32 @SERIALOUTLOP2
SERIALOUTLOP3:0A FA 10 32 @SERIALOUTLOP33
D5
; Serial Input Routine
SERIALIN:3D @SERIALIN
SERIALINLOP1:0A 35 @SERIALINLOP1
SERIALINLOP2:0A FA 08 32 @SERIALINLOP2
2A 4A BF
D5
;
BREAK:3F @BRKRTN
FF 00
BRKRTN:D5


Click here to install.

See Welcome Screen here.
See Main Screen here.
See New ELF II Interface here.
See Options Screen here.
See Tutorial Screen here.

PreviousMenuButtonIcon.png Go back to "Microprocessor View Screen" NextMenuButtonIcon.png Go to "CDP1861 Video Output Screen"