There is only one line of code different between the working and non-working version, so somehow that must be causing the problem.
But as to how or why, I have no idea.
with the next line FAT16 on PORTE works:
BRNE SYSTEM._L1758
but with this line it doesn't
BRCC SYSTEM._L1758
here is rest of routine
SYSTEM._L1759:
RET
But as to how or why, I have no idea.
Code
SYSTEM._DrawVerLineP:
LDD _ACCB, Y+007h
LDD _ACCA, Y+008h
LDD _ACCALO, Y+005h
LDD _ACCAHI, Y+006h
LDD _ACCDLO, Y+003h
LDD _ACCDHI, Y+004h
LDD _ACCBLO, Y+001h
LDD _ACCBHI, Y+002h
LDS _ACCCLO, ViewPortPTR
LDS _ACCCHI, ViewPortPTR+1
STD Z+20, _ACCDLO
STD Z+21, _ACCDHI
STD Z+22, _ACCBLO
STD Z+23, _ACCBHI
LDD _ACCELO, Z+0
LDD _ACCEHI, Z+1
CP _ACCB, _ACCELO
CPC _ACCA, _ACCEHI
BRMI SYSTEM._L1759
LDD _ACCELO, Z+4
LDD _ACCEHI, Z+5
CP _ACCELO, _ACCB
CPC _ACCEHI, _ACCA
BRMI SYSTEM._L1759
CP _ACCBLO, _ACCALO
CPC _ACCBHI, _ACCAHI
BREQ SYSTEM._L1759
BRPL SYSTEM._L1756
PUSH _ACCALO
PUSH _ACCAHI
MOV _ACCALO, _ACCBLO
MOV _ACCAHI, _ACCBHI
POP _ACCBHI
POP _ACCBLO
SYSTEM._L1756:
LDI _ACCDHI, 080h
LDD _ACCELO, Z+2
LDD _ACCEHI, Z+3
CP _ACCALO, _ACCELO
CPC _ACCAHI, _ACCEHI
BRPL SYSTEM._L1757
MOV _ACCALO, _ACCELO
MOV _ACCAHI, _ACCEHI
SYSTEM._L1757:
LDD _ACCELO, Z+6
LDD _ACCEHI, Z+7
CP _ACCELO, _ACCBLO
CPC _ACCEHI, _ACCBHI
BRPL SYSTEM._L1758
MOV _ACCBLO, _ACCELO
MOV _ACCBHI, _ACCEHI
SYSTEM._L1758:
PUSH _ACCB
PUSH _ACCA
PUSH _ACCALO
PUSH _ACCAHI
PUSH _ACCBLO
PUSH _ACCBHI
PUSH _ACCDHI
LDD _ACCDLO, Y+0
AND _ACCDLO, _ACCDHI
BREQ SYSTEM._L1760
RCALL SYSTEM._GraphDotW1
RJMP SYSTEM._L1762
SYSTEM._L1760:
RCALL SYSTEM._GraphDotW0
SYSTEM._L1762:
POP _ACCDHI
LSR _ACCDHI
BRNE SYSTEM._L1761
LDI _ACCDHI, 080h
SYSTEM._L1761:
POP _ACCBHI
POP _ACCBLO
POP _ACCAHI
POP _ACCALO
POP _ACCA
POP _ACCB
SUBI _ACCALO, 0FFh
SBCI _ACCAHI, 0FFh
CP _ACCBLO, _ACCALO
CPC _ACCBHI, _ACCAHI
LDD _ACCB, Y+007h
LDD _ACCA, Y+008h
LDD _ACCALO, Y+005h
LDD _ACCAHI, Y+006h
LDD _ACCDLO, Y+003h
LDD _ACCDHI, Y+004h
LDD _ACCBLO, Y+001h
LDD _ACCBHI, Y+002h
LDS _ACCCLO, ViewPortPTR
LDS _ACCCHI, ViewPortPTR+1
STD Z+20, _ACCDLO
STD Z+21, _ACCDHI
STD Z+22, _ACCBLO
STD Z+23, _ACCBHI
LDD _ACCELO, Z+0
LDD _ACCEHI, Z+1
CP _ACCB, _ACCELO
CPC _ACCA, _ACCEHI
BRMI SYSTEM._L1759
LDD _ACCELO, Z+4
LDD _ACCEHI, Z+5
CP _ACCELO, _ACCB
CPC _ACCEHI, _ACCA
BRMI SYSTEM._L1759
CP _ACCBLO, _ACCALO
CPC _ACCBHI, _ACCAHI
BREQ SYSTEM._L1759
BRPL SYSTEM._L1756
PUSH _ACCALO
PUSH _ACCAHI
MOV _ACCALO, _ACCBLO
MOV _ACCAHI, _ACCBHI
POP _ACCBHI
POP _ACCBLO
SYSTEM._L1756:
LDI _ACCDHI, 080h
LDD _ACCELO, Z+2
LDD _ACCEHI, Z+3
CP _ACCALO, _ACCELO
CPC _ACCAHI, _ACCEHI
BRPL SYSTEM._L1757
MOV _ACCALO, _ACCELO
MOV _ACCAHI, _ACCEHI
SYSTEM._L1757:
LDD _ACCELO, Z+6
LDD _ACCEHI, Z+7
CP _ACCELO, _ACCBLO
CPC _ACCEHI, _ACCBHI
BRPL SYSTEM._L1758
MOV _ACCBLO, _ACCELO
MOV _ACCBHI, _ACCEHI
SYSTEM._L1758:
PUSH _ACCB
PUSH _ACCA
PUSH _ACCALO
PUSH _ACCAHI
PUSH _ACCBLO
PUSH _ACCBHI
PUSH _ACCDHI
LDD _ACCDLO, Y+0
AND _ACCDLO, _ACCDHI
BREQ SYSTEM._L1760
RCALL SYSTEM._GraphDotW1
RJMP SYSTEM._L1762
SYSTEM._L1760:
RCALL SYSTEM._GraphDotW0
SYSTEM._L1762:
POP _ACCDHI
LSR _ACCDHI
BRNE SYSTEM._L1761
LDI _ACCDHI, 080h
SYSTEM._L1761:
POP _ACCBHI
POP _ACCBLO
POP _ACCAHI
POP _ACCALO
POP _ACCA
POP _ACCB
SUBI _ACCALO, 0FFh
SBCI _ACCAHI, 0FFh
CP _ACCBLO, _ACCALO
CPC _ACCBHI, _ACCAHI
with the next line FAT16 on PORTE works:
Code
BRNE SYSTEM._L1758
but with this line it doesn't
Code
BRCC SYSTEM._L1758
here is rest of routine
Code
SYSTEM._L1759:
RET