Search found 205 matches

by DocWaluigean
Wed Jun 10, 2020 5:43 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

TXY Transfer numbers from Register X into Register Y. ??? I do not see this opcode in the Documnentations. Yeah, it doesn't exist. You can do this through a temporary variable, though: stx temp ldy temp Or trough the accumulator, if you're not using it for anything else: txa tay ADC Adds number int...
by DocWaluigean
Wed Jun 10, 2020 5:22 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

is Tepple wrong about the BNE? He's not wrong, he was just giving you an explanation in the context of that particular piece of example code, which IS comparing two values. That's not the only use of the Z flag though. BNE - Branch if Not Equal If the zero flag is clear then add the relative displa...
by DocWaluigean
Wed Jun 10, 2020 4:52 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

So sorry about getting you mad or upset. I'm trying to learn stuff. So let me try recap on what I learned: LDA Load numbers into Register A. LDX Load numbers into Register X. LDY Load numbers into Register Y. TAX Transfer numbers from Register A into Register X. TAY Transfer numbers from Register A ...
by DocWaluigean
Wed Jun 10, 2020 4:36 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

Ok: ADC = Adds numbers into Register A. If OVERFLOW, Carry Flag turns on add 1 to it in the end of equations in Register A. That's it. Shouldn't be complicated. The question is if I can use ADC as alternative to LDA? - CLC = Set Carry Flag to Zero. In other ways, it also means to turn off Carry Flag...
by DocWaluigean
Wed Jun 10, 2020 4:13 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

The example code I wrote is basically nonsense, it's not doing anything useful, I did that only to show you that an operation (in this case, the addition) can be spread out and mixed with other unrelated instructions. ADC - The Opcodes that lets you add numbers to the *ACTIVE A Register* ? Yes, ADC...
by DocWaluigean
Wed Jun 10, 2020 1:56 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

ADC - The Opcodes that lets you add numbers to the previous [line of ] code, or Address. Don't get to hung up on this "previous line of code" thing, because operations aren't necessarily related with the line of code that comes immediately before. For example, I can do this: lda #$03 <-- relevant l...
by DocWaluigean
Wed Jun 10, 2020 10:32 am
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

If I use the ADC, does it turn on the Carry Flag? Or it's only on if the number go overboard? Only if the result goes overboard. LDA #FE ADC #02 STA $1234 Don't forget to put CLC before any additions! If you start an addition while the carry flag is in an unknown state, you may inadvertently add an...
by DocWaluigean
Tue Jun 09, 2020 11:51 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

Now, concerning the way you're going about trying to learn this stuff: programming and computer architecture are not trivial subjects, and it's true that not everyone can understand these things just from reading articles, tutorials and the like. Maybe you would benefit from having a personal tutor...
by DocWaluigean
Tue Jun 09, 2020 11:33 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

Forgot to add something:

LDA #32

ADC #32

STA $0010

It's now storing Number 64 [Get N' or Get Out] into the Address $0010, BUT because I did NOT went overboard with the FF limit, the Carry Flag is STILL on OFF mode?
by DocWaluigean
Tue Jun 09, 2020 11:31 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

So ADC is REALLY just an adding new numbers into the code? It doesn't add anything "into" the code. 99.9% of the code is is static, an immutable program stored in read-only memory (ROM). The ADC instruction simply performs the arithmetic addition of two numbers plus the carry flag. Where these numb...
by DocWaluigean
Tue Jun 09, 2020 10:30 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

-ADC adds new numbers OUT OF THIN AIR into ONE PREVIOUS LINE OF CODE [?] Yes, I picked numbers out of thin air just to demonstrate how ADC and the carry flag work. In a real program it would be pointless to add constant numbers together like that. STA Result.... ? So it's now $117 into the Address ...
by DocWaluigean
Tue Jun 09, 2020 9:52 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

Re-Reading Tokumaru: -ADC adds new numbers OUT OF THIN AIR into ONE PREVIOUS LINE OF CODE [?] STA Result.... ? So it's now $117 into the Address labelled Result, which is standardly impossible for NES to handle this code normally?... LDA [HEX] #$20 = Create number 32 [#$20] out of thin air. ADC #$4B...
by DocWaluigean
Tue Jun 09, 2020 9:43 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

;prevent previous operations from interfering with this one clc ;add two numbers lda #$82 adc #$95 ;$82 + $95 = $117, which is more than $ff, the maximum value a byte can hold, so this addition will set the carry flag ;the accumulator contains the lower 8 bits of the result ($17), which we can save...
by DocWaluigean
Tue Jun 09, 2020 6:22 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

When you're doing an addition on paper, say, 24 + 38, you do it like this: 24 +38 --- 4 + 8 equals 12, which doesn't fit in one digit. What do you do? You carry one over to the next place: 1 24 +38 --- 2 Then you add the 3 digits in the second column to find the final digit in the ten's place: 1 24...
by DocWaluigean
Tue Jun 09, 2020 1:02 pm
Forum: Newbie Help Center
Topic: Hello, I'm back, still need assistences
Replies: 98
Views: 3348

Re: Hello, I'm back, still need assistences

Re-read the previous post from 2 years ago. I'm guessing "CLC" is used to "Erase all the number the Register A, X, and Y is carrying."? No. The CLC (Clear Carry) clears the Carry flag . The "Carry" here means the number carried to the next place when doing arithmetic operations such as addition and...