Skip to content

Arithmetic ​

Arithmetic mnemonics take register operands. See CandleVM arithmetic opcodes for numeric type rules and runtime errors.

CASM mnemonicCandleVM opcodeOperandsBehavior
addAdddestination, left, rightAdds the values in left and right and writes the result to destination.
subSubdestination, left, rightSubtracts right from left and writes the result to destination.
mulMuldestination, left, rightMultiplies the values in left and right and writes the result to destination.
divDivdestination, left, rightDivides left by right and writes the result to destination.
modModdestination, left, rightWrites the remainder of left divided by right to destination.
incIncvalueAdds one to the value in the register in place.
decDecvalueSubtracts one from the value in the register in place.

CandleC validates operand count and register syntax, but does not statically check that the values are numeric.

Built for the Candle ecosystem · Powered by VitePress.