Fixed a bug

git-svn-id: svn://svn.cc65.org/cc65/trunk@1328 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2002-06-23 14:02:09 +00:00
parent 75f57eb1df
commit 84cb41f625

View File

@@ -68,6 +68,9 @@ Header: .res O65_HDR_SIZE ; The o65 header
; Input
InputByte = Header ; Byte read from input
; Relocation
RelocVal = Header + 1 ; Relocation value
.data
Read: jmp $FFFF ; Jump to read routine
@@ -240,8 +243,8 @@ Loop: jsr ReadByte ; Read byte from relocation table
@L2: jsr ReadByte
and #O65_SEGID_MASK
jsr GetReloc
sta ptr1
stx ptr1+1
sta RelocVal
stx RelocVal+1
; Get the relocation byte again, this time extract the relocation type.
@@ -262,7 +265,7 @@ Loop: jsr ReadByte ; Read byte from relocation table
RelocLow:
ldy #0
clc
lda ptr1
lda RelocVal
bcc AddCommon
; Relocate a high byte
@@ -271,9 +274,9 @@ RelocHigh:
jsr ReadByte ; Read low byte from relocation table
ldy #0
clc
adc ptr1 ; We just need the carry
adc RelocVal ; We just need the carry
AddHigh:
lda ptr1+1
lda RelocVal+1
AddCommon:
adc (TPtr),y
sta (TPtr),y
@@ -284,7 +287,7 @@ AddCommon:
RelocWord:
ldy #0
clc
lda ptr1
lda RelocVal
adc (TPtr),y
sta (TPtr),y
iny