ET-3400 ROM - Message Program Assembly
I intended to place this programming test in the new 8K ROM section of the ROM replacement board, however the program I was copying from (out of the ET-3400 Manual) was self-modifying and needed a rewrite so that it would run in ROM and use the RAM in the lower 512 bytes for variables.
After I got into it I thought it would be relatively easy, but I was assuming that the 6800 CPU programming was similar to 6502 CPU programming since the 6502 was modelled on the 6800. However it turns out that was a false assumption, and my programming experience on the 6800 wasn't up to speed.
The 6800 doesn't have indirect addressing mode and the program was self modifying so that it could do a sort-of indirect addressing. Also there were no opcodes to transfer the X register to the ACCA or ACCB register or the stack as far as I could tell.
It was going to take me a lot longer to learn enough basic 6800 code to get this done in time, so I reverted to editing and extending the program in it's original RAM location. The resulting output will be the same though.
This is the final assembler listing of the program with modifications incorporated:
Pass #1
Pass #2
Crasm 1.8: page 1
1 ; RetroChallenge 2021/10
2 ; assembler: crasm in Ubuntu 16.04LTS
3 ; target: ET-3400 Microprocessor Trainer
4 ; original code in ET-3400 manual - Sample4
5 ; modified by Mark C
6 ; date: 26 Oct 21
7
8 CPU 6800 ;target CPU
9
10 OUTPUT HEX ;generate INTEL Hex file
11
12 ILIST ON ;show included files in
listing
13
14 ; SAMPLE 4
15 ; OUTPUTS SAME MESSAGE AS PROGRAM 3
16 ; IN TICKER TAPE FASHION
17 ; USES MONITOR SUB ROUTINES REDIS AND OUTSTR
18
0000 19 * = $0000 ;assemble at $0000
20
21 CODE
22 INCLUDE ET3400MON.TXT
1 ;Heathkit ET3400 built in monitor subroutines
2
3
4
FCBC 5 REDIS = $FCBC ;RESET DISPLAY
FE52 6 OUTSTR = $FE52 ;OUTPUT CHARACTER STRING
00F0 7 DIGADD = $00F0 ;LEFT DIGIT STORAGE
FE3A 8 OUTCH = $FE3A ;OUTPUT SEGMENT
FE28 9 OUTHEX = $FE28 ;DISPLAY DIGIT AND MOVE
CURSOR TO NEXT
C16F 10 DG6ADD = $C16F ;LEFTMOST DIGIT
C15F 11 DG5ADD = $C15F
C14F 12 DG4ADD = $C14F
C13F 13 DG3ADD = $C13F
C12F 14 DG2ADD = $C12F
C11F 15 DG1ADD = $C11F ;RIGHTMOST DIGIT
16
17
23
0000 7F0007 24 START CLR MORE+1 ;CLEAR POINTER
0003 CE002C 25 NEXT LDX #MESSA ;MESSAGE ADDRESS
0006 A600 26 MORE LDAA 0,X ;GET CHARACTER
0008 A745 27 STAA OUT+3-MESSA,X ;STORE CHAR. AT O
UT PLUS
000A 08 28 INX ;NEXT CHARACTER
000B 8C0032 29 CPX #$32 ;FULL WORD YET?
000E 26F6 30 BNE MORE
0010 8D13 31 BSR HOLD ;HOLD DISPLAY
0012 BDFCBC 32 JSR REDIS ;FIRST CHAR. TO LEFT DI
GIT
0015 BD006E 33 JSR OUT
0018 B60007 34 LDAA MORE+1 ;FIRST CHARACTER POINTE
R
001B 4C 35 INCA ;MOVE STRING UP ONE CHA
RACTER
001C B70007 36 STAA MORE+1 ;NEW FIRST CHARACTER
001F 813C 37 CMPA #$3C ;LAST CHAR. TO LEFT DIG
IT YET?
0021 26E0 38 BNE NEXT ;BUILD NEXT WORD
Crasm 1.8: page 2
0023 20DB 39 BRA START ;DO AGAIN
0025 CE8000 40 HOLD LDX #$8000 ;TIME TO WAIT
0028 09 41 WAIT DEX
0029 26FD 42 BNE WAIT ;TIME OUT YET?
002B 39 43 RTS
44
002C 080808080808 45 MESSA DB $08,$08,$08,$08,$08,$08 ;------
0032 056F0F051D00 46 DB $05,$6F,$0F,$05,$1D,$00 ;retro
0038 4E177D30306F 47 DB $4E,$17,$7D,$30,$30,$6F ;Challe
003E 157B6F006D7E 48 DB $15,$7B,$6F,$00,$6D,$7E ;nge 20
0044 6D3025307E00 49 DB $6D,$30,$25,$30,$7E,$00 ;21/10
004A 0000004F0F01 50 DB $00,$00,$00,$4F,$0F,$01 ; et-
0050 79337E7E0000 51 DB $79,$33,$7E,$7E,$00,$00 ;3400
0056 051D15110005 52 DB $05,$1D,$15,$11,$00,$05 ;rom r
005C 6F67307D0D6F 53 DB $6F,$67,$30,$7D,$0D,$6F ;eplace
0062 15116F150F00 54 DB $15,$11,$6F,$15,$0F,$00 ;ment
0068 080808080808 55 DB $08,$08,$08,$08,$08,$08 ;------
56
006E BDFE52 57 OUT JSR OUTSTR ;OUTPUT CHARACTER STRIN
G
58 ; OUTPUT STRING STORED HERE
0071 00000000000080 59 DB $00,$00,$00,$00,$00,$00,$80 ;char bu
ffer and end char
0078 39 60 RTS
61
62 CODE
63
64
ERRORS: 0
WARNINGS: 0
Successful assembly...
Last address 78 (120)
Code length f2 (242)
I ran the program and recorded a video which I will try and upload in my final blog entry next ...
Nice Article. Which Eprom programmer did you use to program chip?
ReplyDeleteHi Tony, The Universal programmer I used to burn the AT28C64 EEPROM is a Wellon VP-299 that I picked up for a bargain on eBay. I believe the TL866 Plus will work too.
DeleteThanks
Delete