Author Topic: 6502 asm - what’s with all the jumping around?  (Read 1295 times)

0 Members and 1 Guest are viewing this topic.

Offline etiTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1801
  • Country: gb
  • MOD: a.k.a Unlokia, glossywhite, iamwhoiam etc
6502 asm - what’s with all the jumping around?
« on: August 17, 2021, 05:27:12 am »
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.
 

Offline retiredfeline

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: au
Re: 6502 asm - what’s with all the jumping around?
« Reply #1 on: August 17, 2021, 05:40:50 am »
Nothing inherent in the CPU. Chances are that system has the lower 32kB mapped at the upper 32kB also.
 

Offline etiTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1801
  • Country: gb
  • MOD: a.k.a Unlokia, glossywhite, iamwhoiam etc
Re: 6502 asm - what’s with all the jumping around?
« Reply #2 on: August 17, 2021, 05:52:14 am »
Nothing inherent in the CPU. Chances are that system has the lower 32kB mapped at the upper 32kB also.

Ah! Now, what does that mean, please? I’m a real newcomer. Thanks ever so. :))
 

Offline retiredfeline

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: au
Re: 6502 asm - what’s with all the jumping around?
« Reply #3 on: August 17, 2021, 06:05:25 am »
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.
 

Online MarkF

  • Super Contributor
  • ***
  • Posts: 2549
  • Country: us
Re: 6502 asm - what’s with all the jumping around?
« Reply #4 on: August 17, 2021, 07:47:04 am »
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 ;D ).
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.
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 657
  • Country: gb
Re: 6502 asm - what’s with all the jumping around?
« Reply #5 on: August 17, 2021, 08:08:41 am »
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.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16618
  • Country: us
  • DavidH
Re: 6502 asm - what’s with all the jumping around?
« Reply #6 on: August 17, 2021, 08:19:10 pm »
Nothing inherent in the CPU. Chances are that system has the lower 32kB mapped at the upper 32kB also.

Ah! Now, what does that mean, please? I’m a real newcomer. Thanks ever so. :))

It 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.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5875
  • Country: de
Re: 6502 asm - what’s with all the jumping around?
« Reply #7 on: August 17, 2021, 10:21:36 pm »
Deleted.

« Last Edit: August 17, 2021, 10:24:02 pm by Benta »
 

Offline RJSV

  • Super Contributor
  • ***
  • Posts: 2121
  • Country: us
Re: 6502 asm - what’s with all the jumping around?
« Reply #8 on: October 14, 2021, 05:41:43 pm »
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
 

Offline gbaddeley

  • Regular Contributor
  • *
  • Posts: 205
  • Country: au
Re: 6502 asm - what’s with all the jumping around?
« Reply #9 on: October 15, 2021, 06:33:52 am »
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.
Glenn
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf