Name | Value |
---|---|
CURRENT_PASS | The current assembly pass |
INT8_MAX | Signed 8-bit maximum value (127) |
INT8_MIN | Signed 8-bit mininum value (-128) |
INT16_MAX | Signed 16-bit maximum value (32768) |
INT16_MIN | Signed 16-bit minimum value (-32768) |
INT24_MAX | Signed 24-bit maximum value (8388607) |
INT24_MIN | Signed 24-bit minimum value (-8388608) |
INT32_MAX | Signed 32-bit maximum value (2147483647) |
INT32_MIN | Signed 32-bit minimum value (-2147483648) |
MATH_E | Constant e |
MATH_PI | Constant π |
MATH_TAU | Constant τ (2×π) |
UINT8_MAX | Unsigned 8-bit maximum value (255) |
UINT8_MIN | Unsigned 8-bit minimum value (0) |
UINT16_MAX | Unsigned 16-bit maximum value (65535) |
UINT16_MIN | Unsigned 16-bit minimum value (0) |
UINT24_MAX | Unsigned 24-bit maximum value (16777215) |
UINT24_MIN | Unsigned 24-bit minimum value (0) |
UINT32_MAX | Unsigned 32-bit maximum value (4294967295) |
UINT32_MIN | Unsigned 32-bit minimum value (0) |
The absolute value of a number.
abs(-1) // 1
The arccosine, or inverse cosine, of a number.
acos(-1) // 3.141592653589793
The arctangent of a number.
atan(1) // 0.7853981633974483
Casts a signed number between -128 and 127 into its unsigned form.
byte(-127) // 81
Converts (or attempts to convert) binary output in unpacked CBM/MBF floating point format into a double floating point number, starting from the address parameter.
// assume in the assembled output, $d000-$d005 contains 82 00 49 0f da a2
cbmflt($d000) // 3.1415926534682512
Converts (or attempts to convert) binary output in packed CBM/MBF floating point format into a double floating point number, starting from the address parameter.
// assume $d000-$d004 contains 82 49 0f da a2
cbmflt($d000) // 3.1415926534682512
The cubed root of a number
cbrt(2048383) // 127
Round up expression.
ceil(0.1) // 1
Converts the codepoint argument into a string. The codepoint must be valid Unicode.
char(0x41) // "A"
The cosine of a number.
cos(1) // 0.54030230586
The hyperbolic cosine of a number.
cosh(1) // 1.54308063482
The degree from radians.
deg(1) // 57.2958
Casts a signed number between -2147483648 and 2147483647 into its unsigned form.
dword(-32768) // 32768
The exponential of e.
exp(16) // 8886110.52051
Round down.
floor(1.9) // 1
Converts objects to a string in the format specified. The format string must adhere to Microsoft .Net standards.
format("Address: ${0:X4}", 49152) // "$C000"
The fractional part.
frac(5.18) // 0.18
Polar distance.
hypot(4,3) // 5
The natural logarithm.
ln(2048) // 7.62461898616
The logarithm in base.
log(2048, 2) // 11
The common logarithm.
log(10000) // 4
Casts a signed number between -8388608 and 8388607 into its unsigned form.
long(-32768) // 32768
Look up generated code output at the offset.
// assume $c000 is 0xa9
peek($c000) // 0xa9
Mutate code generation at the offset and return the value.
Raise to the power.
pow(3, 3) // 9
Radians from degrees.
rad(180) // 3.141592653589793
Generate a random number within the specified range of numbers. Both arguments can be negative or positive, but the second argument must be greater than the first, and the difference between them can be no greater than the maximum value of a signed 32-bit integer. This is a .Net limitation.
random(2, 35) // 17 (maybe)
Generate a sequence of integers until a specified stop point. By default the sequence starts at 0 and increments by a step of 1.
range(5) // [0,1,2,3,4]
range(-1,-6,-1) // [-1,-2,-3,-4,-5]
Round number.
round(18.6) // 19
The starting address of a section.
.dsection "zp", $02, $100
.echo section("zp") // 2
The signum.
sgn(-3) // -1
sgn(0) // 0
sgn(34) // 1
The sine of a number.
sin(34) // 0.52908268612
The hyperbolic sine of a number.
sinh(4) // 27.2899171971
The number of bytes generated by the expression.
sizeof(18404) // 2
// same as 18404.size()
The square root of a number.
sqrt(25) // 5
The tangent of a number.
tan(1) // 1.55740772465
The hyperbolic tangent of a number.
tanh(1) // 0.76159415595
The string representation of the expression's type.
mynum = 3.2
myarray = [mynum, 4.5, 6.3]
mynumtype = typeof(mynum) // "Number"
myarraytype = typeof(myarray) // "Array<Number>"
Casts a signed number between -32768 and 32767 into its unsigned form.
word(-512) // 65024