The following code iterates DO-SOMETHING for 256 times, because loop syntax is compiled to a DECFSZ instruction and the result decrementing zero becomes 255.
(loop 0
(do-something))
How should loop syntax behave when it is passed zero as its argument?
DECFSZ instruction
The contents of register ‘f’ are decremented. ... If the result is ‘1’, the next instruction is executed. If the result is ‘0’, then a NOP is executed instead, ...
The following code iterates DO-SOMETHING for 256 times, because loop syntax is compiled to a DECFSZ instruction and the result decrementing zero becomes 255.
How should loop syntax behave when it is passed zero as its argument?
DECFSZ instruction The contents of register ‘f’ are decremented. ... If the result is ‘1’, the next instruction is executed. If the result is ‘0’, then a NOP is executed instead, ...