Can you please explain a bit about adressing in machine code? I have always
confusions about "absolute, indirect, immediate" concepts.
It will be so easy for me to understand if you give me machine code
counterparts of those basic entries. Especially it is a bit diffucult to
understand interactions with other registers,
Lets think that, A,X,Y are variables in Basic, representing registers
directly. Number in parantheses are memory adresses interested
I understand these..(From LDA command)
Immediate : A=#85 (#A9,#85)
Zero Page : A=PEEK(#85) (#A5,#85)
Absolute : A=PEEK(#8585) (#AD,#85,#85)
But, others are a bit complicated..
Zero Page,X : A=PEEK (#85+X) ?? (#B5,#85)
Absolute,X : A=PEEK (#8585+X) ?? (#BD,#85,#85)
Absolute,Y : A=PEEK (#8585+Y) ?? (#B9,#85,#85)
Indirect,X : A=PEEK (DEEK(#85+X)) OR A=PEEK(DEEK(#85)+X) : (#A1,#85)
Indirect,Y : A=PEEK (DEEK(#85+Y)) OR A=PEEK(DEEK(#85)+Y) : (#B1,#85)
And is there such commands ?
A=PEEK(DEEK(#8585)+Y)
A=PEEK(DEEK(#8585+Y))
Also regarding to ADC command, please fill in the blanks, If there are any
such commands. Please correct if X register is used in such syntaxes instead
of Y )
( ADC is good command to understand addressing with registers. I assume
Carry is zero of course here. If I understand ADC command well, I can apply
this information to other op codes )
A=A+#85 (Immediate) (#69,#85)
A=A+PEEK(#85) (ZeroPage) (#65,#85)
A=A+PEEK(#8585) (Absolute??) (#6D,#85,#85)
A=A+PEEK(#85)+Y
A=A+PEEK(#85+Y)
A=A+PEEK(#8585+Y)
A=A+PEEK(DEEK(#8585+Y))
A=A+PEEK(DEEK(#8585)+Y)
A=A+PEEK(DEEK(#85)+Y))
A=A+PEEK(DEEK(#85+Y))
Thank you from now !!
Sincerely
Oguz