I was trying to "C-ify" some code, and came across the following:
I struggled for a while with IF-ELSE, and gave up. Looking at the problem, I saw there were only two variables, so I tried a truth table.
All of a sudden, it all came clear:
I hope this can help someone else. Actually, I hope no one else needs to convert ASM to C!!
--Rich
Rich (BB code):
ifgt X,#0
jp p05
ifbit B
jp p10
p05:
jsr findbit
jp p20
p10:
jsr ofindbit
p20:
Rich (BB code):
B
\ 0 1
X 0 p05 p10
>0 p05 p05
Rich (BB code):
if((X==0) && (B==1)
ofindbit();
else
findbit()
--Rich