After several days of hard debugging, I discovered a big problem, for P18 mcu.
Code: Select all
program test_MOVLB
dim i as byte absolute $200
dim j as byte absolute $300
main:
i = ((j and $10) >> 4) + 48
end.
This code generate the following asm:
Code: Select all
;test.mbas,7 :: i = ((j and $10) >> 4) + 48
0x001C 0x0102 MOVLB 2
0x001E 0x6B00 CLRF _i, 1
0x0020 0x0103 MOVLB 3
0x0022 0xB900 BTFSC _j, 4, 1
0x0024 0x0102 MOVLB 2
0x0026 0x2B00 INCF _i, 1, 1
0x0028 0x0E30 MOVLW 48
0x002A 0x2700 ADDWF _i, 1, 1
0x0020 0x0103 MOVLB 3
0x0022 0xB900 BTFSC _j, 4, 1
0x0024 0x0102 MOVLB 2
I use version 6.6.2 and will be very nice to have an update for this version with this bug corrected.
Thank you.