• Notice regarding image hosts and attachments. See here.

Assembler Language

Surely it will be hex, so you'll need to convert it to two's compliment binary. So the MSB (most signifcant bit) will be 1 for neg and 0 for postive.

Blackvault
 
Convert to binary and then see if the last bit is 1 or 0 ?

yep its that simple, the LSB is always 1 when its odd and 0 when its even

1 = 0001
2 = 0010
3 = 0011
4 = 0100
5 = 0101
6 = 0110
7 = 0111
8 = 1000
9 = 1001
A = 1010
B = 1011
C = 1100
D = 1101
E = 1110
F = 1111


Code:
Its been awhile but its probably something like this


MOVF SOMEREGISTER,W
BTFSS W,0
GOTO EVEN
//add odd code here
GOTO END
EVEN:
//add even code here
END:
 
Last edited:
Back
Top Bottom