alvin wrote:That's not a syntax error. Do you have a zip available so I can try the compile myself?
The code is something I want to keep private - hopefully the below is enough to figure out why it compiles with -SO2, but fails with -SO3.
This is from the ASM file in the function where the line number was near...
-SO2 - compiles ok:
Code: Select all
; ---------------------------------
; Function test
; ---------------------------------
_test:
push ix
ld ix,0
add ix,sp
push af
dec sp
ld hl,_s1
push hl
call _myfunc2
pop af
ld e,0x00
ld (ix-2),0x00
ld (ix-1),0x00
l_test_00111:
ld a, +((_s1) & 0xFF)
add a,(ix-1)
ld l, a
ld a, +((_s1) / 256)
adc a,0x00
ld h, a
ld b, (hl)
ld d, e
inc d
ld a, b
or a, a
jr Z,l_test_00107
push de
push bc
inc sp
call _myfunc3
inc sp
ld b, l
push bc
inc sp
call _myfunc1
inc sp
ld c, l
pop de
ld (ix-3),c
ld a,(ix-2)
or a, a
jr Z,l_test_00105
ld c, e
ld e, d
ld a, +((_s2) & 0xFF)
add a, c
ld c, a
ld a, +((_s2) / 256)
adc a,0x00
ld b, a
ld a,(ix-3)
add a,0x1d
add a,+((_mystring2) & 0xFF)
ld l, a
ld a, +((_mystring2) / 256)
adc a,0x00
ld h, a
ld a, (hl)
ld (bc), a
ld (ix-2),0x00
jr l_test_00112
l_test_00105:
ld a,(ix-3)
sub a,0x1c
jr NZ,l_test_00102
ld (ix-2),0x01
jr l_test_00112
l_test_00102:
ld c, e
ld e, d
ld a, +((_s2) & 0xFF)
add a, c
ld c, a
ld a, +((_s2) / 256)
adc a,0x00
ld b, a
ld a, +((_mystring2) & 0xFF)
add a,(ix-3)
ld l, a
ld a, +((_mystring2) / 256)
adc a,0x00
ld h, a
ld a, (hl)
ld (bc), a
l_test_00112:
inc (ix-1)
jr l_test_00111
l_test_00107:
ld a,(ix-2)
or a, a
jr Z,l_test_00109
ld c, e
ld e, d
ld a, +((_s2) & 0xFF)
add a, c
ld c, a
ld a, +((_s2) / 256)
adc a,0x00
ld b, a
ld a, (_mystring2 + 28)
ld (bc), a
l_test_00109:
ld hl,_s2
ld d,0x00
add hl, de
ld (hl),0x00
ld hl,_s2
push hl
ld hl,___str_2
push hl
call _printf
ld sp,ix
pop ix
ret
SECTION rodata_compiler
___str_2:
DEFM " :%s"
DEFB 0x0a
DEFB 0x0d
DEFB 0x00
SECTION code_compiler
-SO3 - fails with error message:
Code: Select all
; ---------------------------------
; Function test
; ---------------------------------
_test:
push ix
ld ix,0
add ix,sp
dec sp
ld hl,_s1
push hl
call _myfunc2
pop af
ld c,0x00
ld e,c
ld (ix-1),0x00
l_test_00111:
ld a, +((_s1) & 0xFF)
add a,(ix-1)
ld l, a
ld a, +((_s1) / 256)
adc a,0x00
ld h, a
ld d, (hl)
ld b, c
inc b
ld a, d
or a, a
jr Z,l_test_00107
push bc
push de
push de
inc sp
call _myfunc3
inc sp
pop de
ld a,l
push de
push af
inc sp
call _myfunc1
inc sp
pop de
pop bc
ld a, e
or a, a
jr Z,l_test_00105
ld e, c
ld c, b
ld a, +((_s2) & 0xFF)
add a, e
ld e, a
ld a, +((_s2) / 256)
adc a,0x00
ld d, a
ld a, l
add a,0x1d+<(_mystring2)
ld l, a
ld a, +((_mystring2) / 256)
adc a,0x00
ld h, a
ld a, (hl)
ld (de), a
ld e,0x00
jr l_test_00112
l_test_00105:
ld a, l
sub a,0x1c
jr NZ,l_test_00102
ld e,0x01
jr l_test_00112
l_test_00102:
ld d, c
ld c, b
ld a, +((_s2) & 0xFF)
add a, d
ld b, a
ld a, +((_s2) / 256)
adc a,0x00
ld d, a
ld a, +((_mystring2) & 0xFF)
add a, l
ld l, a
ld a, +((_mystring2) / 256)
adc a,0x00
ld h, a
ld a, (hl)
ld l, b
ld h, d
ld (hl), a
l_test_00112:
inc (ix-1)
jr l_test_00111
l_test_00107:
ld a, e
or a, a
jr Z,l_test_00109
ld e, c
ld c, b
ld a, +((_s2) & 0xFF)
add a, e
ld e, a
ld a, +((_s2) / 256)
adc a,0x00
ld d, a
ld a, (_mystring2 + 28)
ld (de), a
l_test_00109:
ld b,0x00
ld hl,_s2
add hl, bc
ld (hl),0x00
ld hl,_s2
push hl
ld hl,___str_2
push hl
call _printf
pop af
pop af
inc sp
pop ix
ret
SECTION rodata_compiler
___str_2:
DEFM " :%s"
DEFB 0x0a
DEFB 0x0d
DEFB 0x00
SECTION code_compiler