Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@1328 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -68,6 +68,9 @@ Header: .res O65_HDR_SIZE ; The o65 header
|
|||||||
; Input
|
; Input
|
||||||
InputByte = Header ; Byte read from input
|
InputByte = Header ; Byte read from input
|
||||||
|
|
||||||
|
; Relocation
|
||||||
|
RelocVal = Header + 1 ; Relocation value
|
||||||
|
|
||||||
.data
|
.data
|
||||||
Read: jmp $FFFF ; Jump to read routine
|
Read: jmp $FFFF ; Jump to read routine
|
||||||
|
|
||||||
@@ -240,8 +243,8 @@ Loop: jsr ReadByte ; Read byte from relocation table
|
|||||||
@L2: jsr ReadByte
|
@L2: jsr ReadByte
|
||||||
and #O65_SEGID_MASK
|
and #O65_SEGID_MASK
|
||||||
jsr GetReloc
|
jsr GetReloc
|
||||||
sta ptr1
|
sta RelocVal
|
||||||
stx ptr1+1
|
stx RelocVal+1
|
||||||
|
|
||||||
; Get the relocation byte again, this time extract the relocation type.
|
; Get the relocation byte again, this time extract the relocation type.
|
||||||
|
|
||||||
@@ -262,7 +265,7 @@ Loop: jsr ReadByte ; Read byte from relocation table
|
|||||||
RelocLow:
|
RelocLow:
|
||||||
ldy #0
|
ldy #0
|
||||||
clc
|
clc
|
||||||
lda ptr1
|
lda RelocVal
|
||||||
bcc AddCommon
|
bcc AddCommon
|
||||||
|
|
||||||
; Relocate a high byte
|
; Relocate a high byte
|
||||||
@@ -271,9 +274,9 @@ RelocHigh:
|
|||||||
jsr ReadByte ; Read low byte from relocation table
|
jsr ReadByte ; Read low byte from relocation table
|
||||||
ldy #0
|
ldy #0
|
||||||
clc
|
clc
|
||||||
adc ptr1 ; We just need the carry
|
adc RelocVal ; We just need the carry
|
||||||
AddHigh:
|
AddHigh:
|
||||||
lda ptr1+1
|
lda RelocVal+1
|
||||||
AddCommon:
|
AddCommon:
|
||||||
adc (TPtr),y
|
adc (TPtr),y
|
||||||
sta (TPtr),y
|
sta (TPtr),y
|
||||||
@@ -284,7 +287,7 @@ AddCommon:
|
|||||||
RelocWord:
|
RelocWord:
|
||||||
ldy #0
|
ldy #0
|
||||||
clc
|
clc
|
||||||
lda ptr1
|
lda RelocVal
|
||||||
adc (TPtr),y
|
adc (TPtr),y
|
||||||
sta (TPtr),y
|
sta (TPtr),y
|
||||||
iny
|
iny
|
||||||
|
|||||||
Reference in New Issue
Block a user