yeap that worked, keeps switching between -1 and a the equivalent in numbers of 0x7FFFFFFFFrederick C. Wilt said:Sorry I wasn't clear. According to the docs you need a 0x at the beginning to identify a hexadecimal number, so 0x7FFFFFFF.
yeap that worked, keeps switching between -1 and a the equivalent in numbers of 0x7FFFFFFFFrederick C. Wilt said:Sorry I wasn't clear. According to the docs you need a 0x at the beginning to identify a hexadecimal number, so 0x7FFFFFFF.
siafu said:yeap that worked, keeps switching between -1 and a the equivalent in numbers of 0x7FFFFFFF
AZ, I ran this but nothing happened, I mean no value changes that I noticed.az1324 said:Is this what you are doing for absolute value?
MYSUB:
SET RAM1 VAR1
CALLSUB ABS
SET VAR1 RAM1
RET
ABS:
TSTGE RAM1 0
RET
XORB RAM1 -1 RAM1
ADD RAM1 1 RAM1
RET
az1324 said:Is this what you are doing for absolute value?
MYSUB:
SET RAM1 VAR1
CALLSUB ABS
SET VAR1 RAM1
RET
ABS:
TSTGE RAM1 0
RET
XORB RAM1 -1 RAM1
ADD RAM1 1 RAM1
RET
SET RAM1 VAR2
CALLSUB ABS
TSTEQ VAR1 RAM1
az1324 said:siafu -- stop running random codes, man. just leave your WC alone. You should spend time writing out comments of what each line does until you become an expert.
Lou -- that subroutine is the function. Put your value in RAM1, call ABS and the absolute value will be in RAM1 then you can use it to compare.
SET RAM1 VAR2
CALLSUB ABS
TSTEQ VAR1 RAM1
Reuse it for other values as much as you want. Just make sure RAM1 is free in whatever scope you are calling ABS.