The TTY command Q dumps a MOS Technology papertape format to the console.
This requires setting up the end address at 17F7 and 17F8 and selecting the startadres as the current address (POINTL, POINH).
Note that the record count is always $18, so the dump continues beyond the end address specified!
Example run
KIM 0000 00 17F7 17F7 00 FF. 17F8 00 02. 17F9 00 200 0200 00 Q ;180200000000000000000000000000000000000000000000000000001A ;1802180000000000000000000000000000000000000000000000000032 ;180230000000000000000000000000000000000000000000000000004A ;1802480000000000000000000000000000000000000000000000000062 ;180260000000000000000000000000000000000000000000000000007A ;1802780000000000000000000000000000000000000000000000000092 ;18029000000000000000000000000000000000000000000000000000AA ;1802A800000000000000000000000000000000000000000000000000C2 ;1802C000000000000000000000000000000000000000000000000000DA ;1802D800000000000000000000000000000000000000000000000000F2 ;1802F0000000000000000000000000000000000000000000000000010A ;00000B000B 0000 00
The papertape format is described on the Load papertape format.
0866 1DF3 C9 51 CMP #'Q' ; DUMP FROM OPEN CELL TO HI LIMIT 0867 1DF5 F0 0A BEQ DUMPV 0873 1E01 4C 42 1D DUMPV JMP DUMP 0778 1D42 A9 00 DUMP LDA #$00 0779 1D44 85 F8 STA INL 0780 1D46 85 F9 STA INH ; CLEAR RECORD COUNT 0781 1D48 A9 00 DUMP0 LDA #$00 0782 1D4A 85 F6 STA CHKHI ; CLEAR CHKSUM 0783 1D4C 85 F7 STA CHKSUM 0784 1D4E ; 0785 1D4E 20 2F 1E JSR CRLF ; PRINT CR LF 0786 1D51 A9 3B LDA #$3B ; PRINT SEMICOLON 0787 1D53 20 A0 1E JSR OUTCH 0788 1D56 A5 FA LDA POINTL ; TEST POINT GT OR ET 0789 1D58 CD F7 17 CMP EAL ; HI LIMIT GOTO EXIT 0790 1D5B A5 FB LDA POINTH 0791 1D5D ED F8 17 SBC EAH 0792 1D60 90 18 BCC DUMP4 0793 1D62 ; 0794 1D62 A9 00 LDA #$00 ; PRINT LAST RECORD 0795 1D64 20 3B 1E JSR PRTBYT ; 0 BYTES 0796 1D67 20 CC 1F JSR OPEN 0797 1D6A 20 1E 1E JSR PRTPNT 0798 1D6D ; 0799 1D6D A5 F6 LDA CHKHI ; PRINT CHKSUM 0800 1D6F 20 3B 1E JSR PRTBYT ; FOR LAST RECORD 0801 1D72 A5 F7 LDA CHKSUM 0802 1D74 20 3B 1E JSR PRTBYT 0803 1D77 4C 64 1C JMP CLEAR 0804 1D7A ; 0805 1D7A A9 18 DUMP4 LDA #$18 ; PRINT 24 BYTE COUNT 0806 1D7C AA TAX ; SAVE AS INDEX 0807 1D7D 20 3B 1E JSR PRTBYT 0808 1D80 20 91 1F JSR CHK 0809 1D83 20 1E 1E JSR PRTPNT 0810 1D86 ; 0811 1D86 A0 00 DUMP2 LDY #$00 ; PRINT 24 BYTES 0812 1D88 B1 FA LDA (POINTL),Y ; GET DATA 0813 1D8A 20 3B 1E JSR PRTBYT ; PRINT DATA 0814 1D8D 20 91 1F JSR CHK ; COMP CHKSUM 0815 1D90 20 63 1F JSR INCPT ; INCREMENT POINT 0816 1D93 CA DEX 0817 1D94 D0 F0 BNE DUMP2 0818 1D96 ; 0819 1D96 A5 F6 LDA CHKHI ; PRINT CHKSUM 0820 1D98 20 3B 1E JSR PRTBYT 0821 1D9B A5 F7 LDA CHKSUM 0822 1D9D 20 3B 1E JSR PRTBYT 0823 1DA0 E6 F8 INC INL ; INCR RECORD CNT 0824 1DA2 D0 02 BNE DUMP3 0825 1DA4 E6 F9 INC INH 0826 1DA6 4C 48 1D DUMP3 JMP DUMP0 1184 1FCC ; 1185 1FCC A5 F8 OPEN LDA INL ; MOVE I/O BUFFER TO POINT 1186 1FCE 85 FA STA POINTL 1187 1FD0 A5 F9 LDA INH ; TRANSFER INH- POINTH 1188 1FD2 85 FB STA POINTH 1189 1FD4 60 RTS 0917 1E3B 85 FC PRTBYT STA TEMP 0918 1E3D 4A LSR A ; SHIFT CHAR RIGHT 4 BITS 0919 1E3E 4A LSR A 0920 1E3F 4A LSR A 0921 1E40 4A LSR A 0922 1E41 20 4C 1E JSR HEXTA ; CONVERT TO HEX AND PRINT 0923 1E44 A5 FC LDA TEMP ; GET OTHER HALF 0924 1E46 20 4C 1E JSR HEXTA ; CONVERT TO HEX AND PRINT 0925 1E49 A5 FC LDA TEMP ; RESTORE BYTE IN A AND RETURN 0926 1E4B 60 RTS 0927 1E4C ; 0928 1E4C 29 0F HEXTA AND #$0F ; MASK HI 4 BITS 0929 1E4E C9 0A CMP #$0A 0930 1E50 18 CLC 0931 1E51 30 02 BMI HEXTA1 0932 1E53 69 07 ADC #$07 ; ALPHA HEX 0933 1E55 69 30 HEXTA1 ADC #$30 ; DEC HEX 0934 1E57 4C A0 1E JMP OUTCH ; PRINT CHAR 1139 1F91 ; SUB TO COMPUTE CHECKSUM 1140 1F91 ; 1141 1F91 18 CHK CLC 1142 1F92 65 F7 ADC CHKSUM 1143 1F94 85 F7 STA CHKSUM 1144 1F96 A5 F6 LDA CHKHI 1145 1F98 69 00 ADC #$00 1146 1F9A 85 F6 STA CHKHI 1147 1F9C 60 RTS 0895 1E1E ; SUB TO PRINT POINTL,POINTH 0896 1E1E ; 0897 1E1E A5 FB PRTPNT LDA POINTH ; PRINT POINTL, POINTH 0898 1E20 20 3B 1E JSR PRTBYT 0899 1E23 20 91 1F JSR CHK 0900 1E26 A5 FA LDA POINTL 0901 1E28 20 3B 1E JSR PRTBYT 0902 1E2B 20 91 1F JSR CHK 0903 1E2E 60 RTS 1102 1F63 ; SUB TO INCREMENT POINT 1103 1F63 ; 1104 1F63 E6 FA INCPT INC POINTL 1105 1F65 D0 02 BNE INCPT2 1106 1F67 E6 FB INC POINTH 1107 1F69 60 INCPT2 RTS
What is happening here?
DUMP
- clear record count and checksum per record (778 to 783
- print CRLF and ‘;’ (785-787),
note that CRLF is followed by six Null characters $00 - check if end address is reached (subtract POINTL, POINTH for EAL EAH), then dump last record at 794)
- print 00
- print record count (796 – 797)
- print checksum (799-802)
- return to monitor at CLEAR, at 0000 (803)
- write record contents
- print $18 byte count and add to checksum (805-809)
- get and print databytes in a loop (811-817) and add to checksum
- print checksum
PRTBYT
- hift off high part of byte (917-921)
- convert to two hex characters and print (922)
- convert low part to two hex chars and print (923 926)
HEXTA
- mask off high 4 bits
- if A..F add $07 (932)
- add $30 to make ASCII (929, 933)
- print character via OUTCH
See also:
TERC KIM-1 Interface set
A recent acquisition, the TERC (Technical Education Research Centers) KIM-1 Interface set. An educational tool to work w...
6502 tester NMOS CMOS 1-8MHz
The 6502 W65C02 6502C CPU tester NMOS / CMOS 1-8MHz is a CPU tester for 40 pin 6502/65C02 and WD65C02 and Sally.
The...
680x/650x Test system
The 680x/650x Test system allows to test, with the CPU itself performing the test, the MC680X and MCS650X families.
T...
Backbit Chip Tester PRO V2
A simple tio use and effective component test and ROM dump can be done with the wonderful Backbit Chiptester Pro V2.
...