Thowllly wrote:
It's much simpler if you put each of the 8 values in each own table. You avoid having to multiply with 8 and can access everything directly with Y.
Hi Thowilly, that was my previous incarnation of the code revision. It worked fine, no problem. I found that each display column being a seperate table was a tad hard to read for debugging purposes. This form of table makes the entries far easier to understand. The shifting routine for the pointer is used only once during each load, and my program already has a whole slew of time delays to ensure proper operation of some 74LS374 latches.
My mistake was in loading the Y register with the lower value which was ALREADY taken from the offset, so I was doubling the lower pointer which went to blank space at the time.
Here is the working load code. Note that I am not using a loop to load into things because the final 2 values are for seperate display variables.
Also, the reason for multiplying by 8 is because each table entry has 8 entries.
Code:
STZ DisplayTextTablePointerHigh ; Zero the upper base number
LDA DisplayTextString ; Get the pointer
STA DisplayTextTablePointerLow
ASL DisplayTextTablePointerLow ; Shift everything 3 times over
ROL DisplayTextTablePointerHigh
ASL DisplayTextTablePointerLow
ROL DisplayTextTablePointerHigh
ASL DisplayTextTablePointerLow
ROL DisplayTextTablePointerHigh
LDA DisplayTextTablePointerHigh
ADC #$F8 ; Add in the upper base address
STA DisplayTextTablePointerHigh ; And put it back. The pointer is now prepped.
LDY #$00
LDA (DisplayTextTablePointerLow), y ; Get MessageCenter1
STA MessageCenter1
STA Display1
INY
LDA (DisplayTextTablePointerLow), y ; Get MessageCenter2
STA MessageCenter2
STA Display2
INY
LDA (DisplayTextTablePointerLow), y ; Get MessageCenter3
STA MessageCenter3
STA Display3
INY
LDA (DisplayTextTablePointerLow), y ; Get MessageCenter4
STA MessageCenter4
STA Display4
INY
LDA (DisplayTextTablePointerLow), y ; Get MessageCenter5
STA MessageCenter5
STA Display5
INY
LDA (DisplayTextTablePointerLow), y ; Get MessageCenter6
STA MessageCenter6
STA Display6
INY
LDA (DisplayTextTablePointerLow), y ; Get MessageCenterTimer
STA MessageCenterTimer
STA MessageCenterTimerTemp
INY
LDA (DisplayTextTablePointerLow), y ; Get MessageCenterFlickerRate
STA MessageCenterFlickerRate
and the part of the table.
Code:
*= $F800
;DisplayTextTable
.DB $00, $4E, $55, $4C, $4C, $00, $80, $00 ; $00 = NULL character
.DB $00, $00, $00, $00, $00, $00, $80, $00 ; $01 = Blank
.DB $00, $54, $45, $53, $54, $00, $80, $00 ; $02 = TEST
.DB $50, $41, $53, $53, $45, $53, $80, $03 ; $03 = PASSES
you see how it is MUCH more readable for testing and debugging here!