VCCE / VCC

Tandy Color Computer 3 Emulator
GNU General Public License v3.0
64 stars 21 forks source link

6309 Instruction LDBT does not work correctly (VCC 2.1.8.3) #173

Closed dragonbytes closed 1 week ago

dragonbytes commented 5 months ago

I wrote a simple program to reproduce/illustrate:

org     $2800

START lda #%00000010 sta <$00

ldb      #'S'
andb   #%11101111     ; mask out bit 4 just for the test
ldbt     B,1,4,$00           ; this instruction should copy the value of bit 1 in $00 of Direct Page memory to bit 4 in the B register

tfr        B,A
jsr       [$A002]              ; just tells BASIC to print the char in A register

INFINITY bra INFINITY END START

The correct output on a coco with a 6309 CPU should be to print a "S" character and then wait in an infinite loop (so BASIC interpreter doesn't overwrite our outputted character). The LDBT instruction seems to just clobber the B register and load it with the value $EF instead under VCC v2.1.8.3 and the outputted character is a blue solid block instead of the character "S". The same thing happens in older versions as well.

ejaquay commented 4 months ago

PR #179 addresses this issue.

ejaquay commented 1 week ago

Corrected with commit f006cd8