VCCE / VCC

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

Correct LDBT instruction #179

Closed ejaquay closed 7 months ago

ejaquay commented 7 months ago

Addresses Issue #173

ejaquay commented 7 months ago

`;;=================================================== ;; testing ldbt instruction ;; ;; The LDBT instruction loads the value of a specified bit ;; in memory into a specified bit of either the A, B or CC ;; registers. None of the Condition Code flags are affected ;; by the operation unless CC is specified as the register, ;; in which case only the destination bit will be affected. ;; Only Direct Addressing is permitted. ;; ;; Instruction format: ;; LDBT, post-byte, memory location ;; ;; The post-byte contains the register, source and ;; destination bit information and the memory location ;; is the 8 bit direct mode memory location to be used ;; ;; Mnemonic format: ;; LDBT reg,src-bit,dst-bit,loc ;; ;; Build with: ;; lwasm -b -o ldbt.bin ldbt.asm ;; ;;===================================================

;82 R 0101 0010 ;83 S 0101 0011 ;86 V 0101 0110

org $4000 START

lda #$4 ; set bit 2 at $FO sta $F0

ldb #82 ;'R' ldbt B,2,0,$F0 tfr B,A ; expect 'S' (got 0xFE) jsr [$A002]

lda #82 ;'R' ldbt A,2,0,$F0 ; expect 'S' jsr [$A002]

lda #82 ;'R' ora #1 ; expect 'S' jsr [$A002]

lda #82 ;'R' ora $F0 ; expect 'V' jsr [$A002]

rts end START `