diff options
Diffstat (limited to 'README.txt')
-rw-r--r-- | README.txt | 32 |
1 files changed, 17 insertions, 15 deletions
@@ -34,7 +34,7 @@ it'll actually run in its new location. Unfortunately, the code can only be relocated by multiples of 256 bytes. The low bytes aren't adjusted. So unless MEMLO happens to -contain $FF in its low byte, some memory will be wasted (up to 256 +contain $FF in its low byte, some memory will be wasted (up to 255 bytes). The code from Insight: Atari is doesn't produce self-relocating @@ -229,30 +229,32 @@ $09 $40 ; hi byte of LDA $4015 operand $10 $40 ; hi byte of LDA $4016 $00 $00 ; terminator -Low byte relocation table: - -$01 $40 ; lo byte of JSR $4007 operand -$04 $40 ; lo byte of JSR $400E operand -$08 $40 ; lo byte of LDA $4015 operand -$0F $40 ; lo byte of LDA $4016 -$00 $00 ; terminator - Program loads from $4000 to $4016. If MEMLO was $1CFC, the relocator -will move the program to $1CFC - $1D12 and set MEMLO to $1D13. The +will move the program to $1D00 - $1D16 and set MEMLO to $1D17. The operand of the first instruction (was JSR $4007) will be altered -to $1D03 (aka $4007 - $4000 + $1CFC), which is the address that the +to $1D07 (aka $4007 - $4000 + $1CFC), which is the address that the subroutine got relocated to. The original program assembled to a 32-byte file. The relocatable -version will be around 200 bytes: 28 bytes for the original file -(minus its INITAD segment), ~128 bytes for the relocator code, 8 bytes -for the address table, and 20 bytes for the two relocation tables. +version will be around 400 bytes: 28 bytes for the original file +(minus its INITAD segment), ~300 bytes for the relocator code, 8 +bytes for the address table, and 10 bytes for the relocation table. However, the relocator and tables are only used once, and can be overwritten afterwards (so they count as free memory). Relocation Table Format -Bitmap. +Current implementation: + +A list of addresses that need to be adjusted (high bytes of absolute +addresses), 2 bytes each, terminated with $00 $00. + +Possible future implementation: + +Bitmap. One bit per byte in the file. 1 if the address needs +adjusting, 0 if not. This *probably* will actually be smaller than +the list of addresses. Also has the advantage of being a fixed size, +easily calculated/predicted. The relocator is 256 bytes long or less. The GR.0 display list with a 16K cart in is at $7C20. |