Apple

[Q] Apple ][ 6502 machine language addressing

I have a question regarding 6502 machine language. It's about the memory addressing.

Example:

0600: a9 01 8d 00 02 a9 05 8d 01 02 a9 08 8d 02 02

Address Hexdump Dissassembly
-------------------------------
$0600 a9 01 LDA #$01
$0602 8d 00 02 STA $0200
$0605 a9 05 LDA #$05
$0607 8d 01 02 STA $0201
$060a a9 08 LDA #$08
$060c 8d 02 02 STA $0202

My question is:


Is the address $0600 in little endian notation?
Is this page memory 06 -> 6 * 256 = 1536 decimal + offset 0 = 1536?
And $0602 is at 0x06 x 0x100 = page n + offset 2 = 1538 d

thanks

Mike
Image x1 Image x2
The answer to your first question is yes, every address in 6502 ASM is little endian, O took a course on it when I was trying for electrical engineering.

The other two questions I can't remember enough of the class to definitely answer.
:fuel: 900MHz 4GB
'$0600' is hexadecimal notation. There is no such thing as "little endian notation": endianness is about how numbers are stored in memory, not how they are written.

$0600 is simply 6*16^2 or 1536. You can enter numbers in either base to the assembler, it doesn't care. Usually the syntax is #42 for decimal constants or #$2A for hexadecimal constants. When using unix or C tools, the syntax usually is 42 for decimal, or 0x2A for hexadecimal. You aren't likely to find much C software on a 6502, although compilers did exist for the Apple ][ and others.

Pages are a virtual memory concept. I can't think of too many 6502s that implement virtual memory, but that doesn't mean they aren't out there.
:PI: :O2: :Indigo2IMP: :Indigo2IMP:
robespierre wrote: Pages are a virtual memory concept. I can't think of too many 6502s that implement virtual memory, but that doesn't mean they aren't out there.

No, "pages" on the 6502 are sections of 256 bytes, although the only ones that are special are zero page (which can be addressed in a single byte, as well as also having the only general-purpose indirect-addressing modes) and page 1 (which doesn't have any special addressing modes, but serves as the stack.)

OP: As has been stated, and as you more or less inferred, $0600 is just the conventional way of writing a 16-bit hexadecimal number, and doesn't have anything to do with the endianness of the CPU. A value of $0600 stored in memory on the 6502 is going to look like $00 $06 in a hex dump, but on a 68000 it would be $06 $00 instead.
Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
Synthesizers: Roland JX-10/D-50/MT-32/SC-55k, Ensoniq SQ-80/Mirage, Yamaha DX7/V-50/FB-01/SY22, Korg DW-8000/MS-20 Mini/ARP Odyssey/M1/03-RW, E-mu Emax HD/Proteus/2, Rhodes Chroma Polaris