Code: Select all
?I000291_F005_000142_P000064 ; L#MK IF (RCIF = 1) THEN
BTFSS PIR1,5,0
BRA ENDIF_59
?I000294_F005_000150_P000064 ; L#MK IF (RXSTAT.OERR = 1) THEN
BCF STATUS,3,0
BTFSS M71_U01,1
BSF STATUS,3,0
BOV ENDIF_60
?I000301_F005_000165_P000064 ; L#MK IF (NEWPACKET = FALSE) THEN
BCF STATUS,3,0
BTFSC M61_U01,0
BSF STATUS,3,0
BTFSC STATUS,3,0
BRA ENDIF_61
The thing I don't understand is all of the instructions dealing with the STATUS register bit 3 (the OV bit??) in the second and third cases. Why is the third case so complicated?
Can't it just test the bit like is done in the first case?
Both variables involved are module-level declared as:
Code: Select all
public dim NewPacket as boolean // packet available flag
public structure rcsta_reg_t
b as byte
spen as b.bits(7)
rx9 as b.bits(6)
sren as b.bits(5)
cren as b.bits(4)
adden as b.bits(3)
ferr as b.bits(2)
oerr as b.bits(1)
rx9d as b.bits(0)
end structure
public dim rxstat as rcsta_reg_t
Is there any way to optimize the tests?