Board issues

OK. So the code would look like this...

start
callsub resets
tstle t1 500
goto flag1
tstle t1 400
goto flag2
end

resets:
tstge t1 510
callsub resett1
tstge t1 410
callsub resett2
ret

resett1:
andb var1 1
bnz sett1zero
ret
sett1zero:
xorb var1 1 var1
ret

resett2:
andb var1 2
bnz sett2zero
ret
sett2zero:
xorb var1 2 var1
ret

flag1:
andb var1 1 ram1
tsteq 0 ram1
email em1
orb var1 1 var1
ret

flag2:
andb var1 2 ram1
tsteq 0 ram1
email em2
orb var1 2 var1
ret
 
This should work. If during debug process you have any problem, you can look the var1 value to see where could be the problem.
 
Ross is right, if you using a calculator, you can enter it 2^y, where y is the position you want it to be. Saying 2^31 would be 2147483648
Or you can simple put calculator in bin mode, enter the 1 into the bit position you want to be, then click on Dec to see in decimal mode what the value to be.
 
Back
Top