Page 2 of 2

Re: BIT Instruction

Posted: Sat Jan 22, 2022 9:23 pm
by IamRob
I never know how to portray the *+1 when displaying here as some assemblers use *+1 and some use *+3. I don't know what the common understanding is. I guess I should have used a label instead. BTW, I do short tests like this in the mini-assembler and have to type it in to the forums.

But I missed a line anyways.
It should have been

Code: Select all

lda #0
   sta $6

   lda #$FF
   bit $6
   beq label
   rts

label
   brk
   brk
In my tests this routine falls through an doesn't crash. If it is a bug in my emulator, that has been the reason I have avoided programming that way. But I just tested again and it and DOH! it works.

Re: BIT Instruction

Posted: Sun Jan 23, 2022 12:06 am
by BruceRMcF
IamRob wrote:
I never know how to portray the *+1 when displaying here as some assemblers use *+1 and some use *+3. I don't know what the common understanding is. ...
Since I used an C64 assembler back in the day that used the "+" for transient labels, and now use ACME, I never got into using "*" based relative branch addressing ...
... and, yes, why I noted that it might be assembler dependent. Testing, I see that ACME takes it as set at the beginning of the line of assembly, presumably until that line of assembly is completed, so it would be *+3 for ACME to get a branch operand of $01 (given that 6502 branch operands are relative to the start of the following opcode).

But when I first used it, it was the MOS6510 that decided for me how an opcode works, and AFAIR, setting the zero flag the same as an AND would have done is how BIT has always worked.

Re: BIT Instruction

Posted: Wed May 25, 2022 8:26 pm
by Jmstein7
GARTHWILSON wrote:

I cannot pass up the opportunity to recommend the excellent programming manual, "Programming the 65816 including the 6502, 65C02, and 65802" by David Eyes and Ron Lichty. This is a .pdf file of a rather large book that is well laid out and is much better than the description there lets on. Note: There were many problems with the earlier .pdf version that were not in the original paper manual; but in late March 2015, WDC scanned and OCR'ed the paper manual and posted the new, repaired .pdf. Chapter 18 gives at least a page for every instruction, telling exactly what it does, and covering all the addressing modes, cycle counts, etc..
What do you think of the Kindle Unlimited version of the programming manual, Garth? J

Re: BIT Instruction

Posted: Wed May 25, 2022 9:09 pm
by GARTHWILSON
Jmstein7 wrote:
What do you think of the Kindle Unlimited version of the programming manual, Garth? J
I don't know. Is there a date on it? (I don't do Kindle, only PC.)

Re: BIT Instruction

Posted: Wed May 25, 2022 9:20 pm
by Jmstein7
GARTHWILSON wrote:
Jmstein7 wrote:
What do you think of the Kindle Unlimited version of the programming manual, Garth? J
I don't know. Is there a date on it? (I don't do Kindle, only PC.)
It looks like its the 2015 soft-cover version.

Re: BIT Instruction

Posted: Wed May 25, 2022 9:56 pm
by GARTHWILSON
Jmstein7 wrote:
[It looks like its the 2015 soft-cover version.
In late March 2015, WDC scanned and OCR'ed the paper manual and posted the new, repaired .pdf. The .pdf that was distributed before that had problems. I bought my paper version in the 1990's, and it came in a ring binder. I was never aware of a soft-cover version.

Re: BIT Instruction

Posted: Thu May 26, 2022 3:33 pm
by Jmstein7
GARTHWILSON wrote:
In late March 2015, WDC scanned and OCR'ed the paper manual and posted the new, repaired .pdf. The .pdf that was distributed before that had problems. I bought my paper version in the 1990's, and it came in a ring binder. I was never aware of a soft-cover version.
Yeah, it looks like it was released along with (at the same time as) the single-board dev boards (SBX, QBX, etc.).