Users browsing this thread: 1 Guest(s)
My Assembly Notes

#1
Posts: 1,261
Threads: 250
Thanks Received: 11
Thanks Given: 7
Joined: Jun 2009
Status
Traitor
Just a list of things I'm learning through assembly, starting on this page as the OPcode.
JSR works by pushing a pointer to the stack: The RTS repeals it.
JMP goes to an address and never comes back. JSR goes to an address, then comes back to the point where you called it by calling an RTS (Return from Subroutine)

Quote:<Zeemis> Is LDA usually A9 and A5?
<Zeemis> Here is an example: C0/AE0D: A5EB LDA $EB (load parameter, character)
<Zeemis> What are the differences between A9 and A5?
<Sliver-X> variants*
<Sliver-X> A9 loads a literal value, A5 is a memory address.
<Sliver-X> Zero page, IIRC.
<Zeemis> What do you m ean by literal value and memory address?
<Zeemis> Do you mind me asking you these questions?
<Sliver-X> A literal value means, well, you're loading a specific byte into A.
<Sliver-X> An address loads the value at whatever address into the accumulator.
<Sliver-X> JMP is 4D, JSR is 20. RTS is 60.
<Sliver-X> Branches like BNE, BEQ, etc are relative JMPs of sorts that are triggered on conditions.
Quote:<Sliver-X> LDX and LDY also have Zero Page, Memory and Literal functions.
<Sliver-X> If the SNES's CPU has more registers I guess those would too.
<Sliver-X> (The 6502 only has A, X and Y)
<Zeemis> I've been reading up on LDX and LDY: http://richardbowles.tripod.com/durham/c...htm#ldxldy
<Zeemis> LDX LDY and LDA are similar beacuse of what you just said?
<Sliver-X> Loading and Storing them? Yes, they behave the same.
<Sliver-X> However, you can only do math functions with A.
<Sliver-X> X and Y are index registers, not math ones.
<Sliver-X> LDX and LDY also have Zero Page, Memory and Literal functions.

LDA is either A5 or A9 and it stands for Load Acumulator. An accumulator is a register.
Quote:<Sliver-X> It's a register. A register is, in this case, a one byte (8 bit) cell of RAM inside the CPU itself.
<danke> It's like a pocket, that can fit one thing in it.
Quote:<danke> And if you LDA #$05, you're taking whatever byte is at 05, and putting it in that pocket. Then if you STA $FF00, you take it from the pocket, and put a copy of it at $FF00.
Quote:$ = address.
# = value.
#$ means Literal Hex value.

Quote:Zeemis> and TAX?
<danke> TAX takes what's in A, and copies it to X.
<danke> Transfer A to X.
  Find
Quote  

#2
Posts: 831
Threads: 41
Thanks Received: 16
Thanks Given: 12
Joined: Nov 2009
Reputation: 18
Status
None
I can help a little here:

JSR - Jump to Subroutine - uses the opcode "20", used to "jump" to any address in the same bank. Two bytes needed. Once the jump is done and the code is executed, a "RTS" (return from subroutine) is needed - opcode is "60".

Example: 20 63 53 - go to address 5363.

JSL - Jump to Subroutine LONG - uses the opcode "22". Can jump to any address in the ROM. After jumping and executing the code, needs a "6B" opcode to return.

Example: 22 63 53 C2 - go to address C2/5363.

JMP - "Jump", opcode "4C". I believe you cannot jump to other banks using this command.

Example: 4C 93 22 - go to address 2293.

ASL - opcode "0A", used as arithmetic to multiply a number by power of two each time it's called.

Example: to multiply a variable by 16, you would need to use 4 consecutive 0A commands.
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite