Search found 11 matches

by Alucard
Thu Apr 06, 2006 10:01 pm
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

I'm gonna do some more research into this another time. I do have one quick question. I know that BRK, IRQ and NMI are 7 clock cycles long but how about RESET?
by Alucard
Thu Mar 30, 2006 9:57 am
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

If the accumulator is $FF and you add, say $01 then the result is $66. $42 + $01 = $43. Here is what I am sure of;

SED
CLC
LDA #$FF

// ADC

if( (A & 0xF0) > 0x90 )
A += 0x60;
if( (A & 0x0F) > 0x09 )
A += 0x06;

// A = $65

A += Immediate; ($01)

// A = $66


The immediate data is NOT converted.
by Alucard
Tue Mar 28, 2006 3:46 pm
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

Here is proof; (performed on an Atari 2600 Jr. with a Starpath SuperCharger)

Code: Select all

SED
CLC
LDA #$FF
ADC #$01

or

F8 18 A9 FF 69 01
I then execute code that displays the accumulator as 1's and 0's on the screen. The result is $66 (01100110).
by Alucard
Mon Mar 27, 2006 7:54 pm
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

dclxvi wrote:
Sigh. Once again, the 6502 (or 65C02 or 65816) NEVER converts to BCD before performing an addition or subtraction.
Actually my Atari 2600's 6507 does.
by Alucard
Fri Mar 17, 2006 12:39 pm
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

I have recently purchased an Atari 2600 and a Supercharger and have been testing the 6507 inside for my 6502 emulator. I have answered all of my own questions but have raised one. In decimal mode if the Accumulator or Operand is not a BCD number then this has a big affect on ADC/SBC. Does anybody ...
by Alucard
Mon Feb 27, 2006 9:45 pm
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

Ok, when do you set the N, V and Z flags when working in 65C02 mode? Obviously, the Z flag is set on a 0 but when do you set the N and V flags? I can't imagine it being the same as binary mode (i.e. > 0x79 == N).
by Alucard
Thu Feb 23, 2006 4:53 pm
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

Thanks for the responses, I have some more questions;

1. Is the accumulator converted to a BCD number if the Decimal flag is set and it contains a non decimal number?

2. With illegal opcode AAX, do you set the N and Z flags? Half the documents say yes and the other half say no.

3. How is the N ...
by Alucard
Wed Feb 15, 2006 9:33 pm
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

Hey blargg it's your best buddy (lol...) from nesdev here WedNESday.

My 6502 emulator is not just for the NES it is for any system so there are no specifics. I still feel that my questions have been unanswered though. I know that N, V and Z are undefined in decimal ADC/SBC, so if we tried...
SED ...
by Alucard
Wed Feb 15, 2006 11:37 am
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

So are they sometimes set correctly, and other times not? When are the N and V flags set when decimal mode is on because it can't be the same as binary mode. I am still confused right now so I will post some of my code. BCDAccumulator and BCDByte make sure that the number is not hexadecimal ...
by Alucard
Tue Feb 14, 2006 9:30 pm
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

Thanks for the replies. Just to clarify one thing though. You all say that the N, V and Z flags are undefined in decimal ADC/SBC. Currently, I clear the three flags whenever a ADC/SBC opcodes is encountered. If decimal mode is set then they are not affected. Is this right? Or do the flags equal ...
by Alucard
Tue Feb 14, 2006 2:46 pm
Forum: General Discussions
Topic: Questions
Replies: 31
Views: 14691

Questions

Hello Everyone. Some of you may already know me as WedNESday from the nesdev forums. I have some 6502 questions that are better asked here than there. This is for my 6502 emulator;

1. What are the Power Up values of the registers/memory?

2. Is the Interrupt Disable flag set on a RESET/NMI?

3. In ...