Skip to content

title: "mod16" description: TRSE built-in method (from IDE help)


mod16

Systems: X16,C64, MEGA65, PLUS4, C128, VIC20, NES, OK64, PET, ATARI2600, APPLEII, SNES, ORIC, BBCM, ACORN, ATARI800
Parameters: ib,b


Returns the modulo of parameter 1 with parameter 2 for 16-bit numbers. Only applies for the 6502.

Examples:

i:=mod(i+1,1000); // is is kept between 0 and 1000

k:=mod(k*2,j); // is is kept between 0 and j