Jump to content

Photo

About roms start address


3 replies to this topic

#1 Nop90 OFFLINE  

Nop90

    Star Raider

  • 51 posts
  • Location:Italy

Posted Wed Dec 5, 2018 1:41 PM

Just for curiosity (probably this is a silly question).

 

Why is so common in 4kB commercial roms to have start address at 0xF000? (same for 2kB roms starting at 0xF800).

 

My idea is that this could be related to the original atari dev kit. Maybe to run the code in debug mode on the host developement machine in a memory area normally unused.

 

Or maybe it's only a coding convention.

 

 



#2 SpiceWare ONLINE  

SpiceWare

    Draconian

  • 12,631 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Wed Dec 5, 2018 2:25 PM

Most likely because 6502 assembly programmers are familiar with this - Internals of BRK/IRQ/NMI/RESET on a MOS 6502
  
SIGNAL    VECTOR
NMI       $FFFA/$FFFB
RESET     $FFFC/$FFFD
IRQ/BRK   $FFFE/$FFFF
 

By setting the ROM start at $F000 (or $F800 for 2K) then those vectors end up where people expect them to be even though the 6507 treats $1FFA, $3FFA, .., and $FFFA as the same address.

#3 Nop90 OFFLINE  

Nop90

    Star Raider

  • Topic Starter
  • 51 posts
  • Location:Italy

Posted Wed Dec 5, 2018 2:53 PM

Thanks, this makes sense. So after all it's a coding convention.

 


By setting the ROM start at $F000 (or $F800 for 2K) then those vectors end up where people expect them to be even though the 6507 treats $1FFA, $3FFA, .., and $FFFA as the same address.

 

 

This brings to my mind that I made an error with some code I wrote to relocate roms to phisical 13 bits addresses (trying to save some instructions to make z26 run at acceptable speed on the 3ds); I relocated 2k roms to 0x1000, just like 4k roms, but the correct position should be 0x1800 to have the interrupt vector(s) at the right position.

 

Strange thing is that the relocated roms work fine on the emulator (using javatari), but probably it's because the emulator, with 2k roms, ignores bit 13 of the addresses (just like happens with phisical 2k cartridges)



#4 Nukey Shay ONLINE  

Nukey Shay

    Sheik Yerbouti

  • 21,867 posts
  • Location:The land of Gorch

Posted Mon Dec 10, 2018 5:19 AM

Actually, this is also how the 2600 operates.  With a 2k Rom, the other half of the 4k block does not exist.  Access to $1000-17FF is then treated the same as access to $1800-$1FFF.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users