6502 asm - what’s with all the jumping around? - Page 1
Forum section: electronics / general

author: eti
author_rank: Super Contributor
timestamp: August 17, 2021, 05:27:12 am
content: Hello.I’m new to 6502 asm and machine code, forgive my ignorance.Reset vector looks in fffc-ffffd for two bytes which are the start execution address. Now, elsewhere online, I see that this is also related to 7ffc-7ffd, but can’t fathom quite why.Also, why is address 8000 linked to address 0000? I’m sure it’s to do with memory mapping, but would be delighted if someone could clear it up in a clear and simple manner for me.Many Thanks indeed.

author: retiredfeline
author_rank: Frequent Contributor
timestamp: August 17, 2021, 05:40:50 am
content: Nothing inherent in the CPU. Chances are that system has the lower 32kB mapped at the upper 32kB also.

author: eti
author_rank: Super Contributor
timestamp: August 17, 2021, 05:52:14 am
content: Quote from: retiredfeline on August 17, 2021, 05:40:50 amAh! Now, what does that mean, please? I’m a real newcomer. Thanks ever so.)

author: retiredfeline
author_rank: Frequent Contributor
timestamp: August 17, 2021, 06:05:25 am
content: That usually happens when the memory space only partly used so they just omit using the upper address lines, A15 in this case, in decoding so the memory appears in two ranges of addresses. Sometimes bank switching is involved. It all depends on the particular system.

author: MarkF
author_rank: Super Contributor
timestamp: August 17, 2021, 07:47:04 am
content: My first computer was an Apple ][ with a 6502 processor.Some where in upper memory (in the area you're asking about) was a hole (i.e. no physical memory) in the memory.That area included space to address the video memory, the floppy drive and address space for the I/O cards.I would have to go dig out the old manuals to find the memory allocation (which I still have).And the Apple still works!I don't remember how or where the interrupt vectors work any more. You need to find a 6502 datasheet.Oh, and there is also the boot ROM and BASIC interpreter in upper memory space.

author: nali
author_rank: Frequent Contributor
timestamp: August 17, 2021, 08:08:41 am
content: Quite simply back then memory address decoding was done with discrete logic from the 16 address lines A0 through A15. If the system was designed only to ever need half the 64K then why bother decoding all the address lines?So the memory isn't deliberately "mapped" as such, it's just an artefact of not using the most significant hardware address line. Write down the two addresses in binary, then erase the leftmost digit.

author: David Hess
author_rank: Super Contributor
timestamp: August 17, 2021, 08:19:10 pm
content: Quote from: eti on August 17, 2021, 05:52:14 amIt means that when the installed memory is only a fraction of the address space, there is little reason to fully decode the address so the more significant bits of the address get ignored rather than decoded. This leads to the memory being duplicated at multiple addresses.

author: Benta
author_rank: Super Contributor
timestamp: August 17, 2021, 10:21:36 pm
content: Deleted.

author: RJSV
author_rank: Super Contributor
timestamp: October 14, 2021, 05:41:43 pm
content: Basic level, and middle-complex 6502: Your brief questions I will answer, just PM your 6502 question, mostly on instruction actions. The previous answers help with specific machines, using 6502 IC plus using the 'Signal' type. I think, historically linked to 6800 family type (loosely ?).But sure, ask any 6502, I am mid-level exp.(Wrote 'XEVIOUS' C-64, but that was 35 years ago !).Might take few days for responses, thanks.Rick

author: gbaddeley
author_rank: Regular Contributor
timestamp: October 15, 2021, 06:33:52 am
content: The Apple ][ had a 16 bit address space, with the monitor / AppleSoft basic rom at the top end, so that it had the reset/ int vectors in rom. Below the rom was addr space for video and I/O. Below that was ram for programs. (this is a simplified view). I still have my Apple ][ from 1983.