I'm trying to disassemble some code and cannot reconcile it with my interpretation of the datasheet.
During the initialization we have
Code:
lda #$00
sta viabifr
sta viaaifr
lda #$80
sta viabier
sta viaaier
I'm guessing this is attempting to disable interrupts but seems wrong.
I don't see what writing all zeros will achieve, the Rockwell datasheet reads
Quote:
... individual flag bits can be cleared by writing a "1" into the appropriate bit of the IFR.
The write to the IER looks equally odd, the datasheet says
Quote:
Selected bits in the IER can be set by writing to the IER with bit 7 in the data word set to a 1.
...
For each zero, (of bits 6 to 0) the corresponding bit will be unaffected.
So this looks like a no-op.
Am I misunderstanding the datasheet or is the code nuts?