This VIA test program should count upwards on port A, but it isn't doing so.
This is the code I'm using(hand-assembled):
Code: Select all
;The VIA is at $6000
LDA #FF A9 FF
STA VIA.DDRA 8D 03 60 ;Set the VIA's port A to all outputs
LDA #00 A9 00
STA VIA.ORA 8D 01 60 ;Set the VIA port to all low
INC A 1A
BNE -2 D0 FE ;This is supposed to be a delay loop; at 1 MHz, it should produce enough delay to see the count rise on the LEDs.
;The branch displacements are determined by starting at 0 on the branch operand, and counting backwards to the first byte of the desired destination instruction.
INC VIA.ORA EE 01 60
BRA -7 80 F9 ;Branch into the waiting loopI have also tested the connections on the board with a multimeter, and they trigger the continuity beeper, so that's not the problem either.
The way I see it, there's two options: I could have done something wrong with the program(the BNE springs to mind), or the VIA could be a dud.
Have I done anything wrong here?