|
c128lib Common
Various common functionalities.
|
Math module. More...
Functions | |
| macro | add16 (value, dest) |
| macro | sub16 (value, dest) |
| macro | addMem16 (source, destination) |
| macro | subMem16 (source, destination) |
| macro | asl16 (value) |
| macro | inc16 (address) |
| macro | dec16 (destination) |
| macro | mulAndAdd (left, right, targetAddr) |
| macro | div16By16 (dividend, divisor, remainder) |
| macro | div16By8 (dividend, divisor, remainder) |
Variables | |
| pseudocommand add16 | source |
| pseudocommand asl16 | low |
| pseudocommand inc16 | address |
| pseudocommand dec16 | destination |
Math module.
Macros for math.
| macro add16 | ( | value | , |
| dest | ) |
Adds 16 bit number value to given memory cell specified by dest address and set result to dest.
| [in] | value | first addend |
| [in,out] | dest | memory location for second addend and result |
| macro addMem16 | ( | source | , |
| destination | ) |
Adds value from "source" memory location to value in "destination" memory location.
| [in] | source | first addend |
| [in,out] | dest | memory location for second addend and result |
| macro asl16 | ( | value | ) |
Shifts left 2 byte number specified with address. Carry flag indicates last bit that has been "shifted out".
| [in,out] | value | address to shift |
| macro dec16 | ( | destination | ) |
Decrements 16 bit number located in memory address starting from "destination".
| [in,out] | address | address to shift |
| macro div16By16 | ( | dividend | , |
| divisor | , | ||
| remainder | ) |
Divides the two-byte number dividend by the two-byte number divisor, leaving the quotient in dividend and the remainder in remainder. Addressing mode of 16-bit numbers uses little endian.
| [in,out] | dividend | dividend and also quotient |
| [in] | divisor | divisor |
| [out] | remainder | remainder (wide as divisor) |
| macro div16By8 | ( | dividend | , |
| divisor | , | ||
| remainder | ) |
Divides the two-byte number dividend by the one-byte number divisor, leaving the quotient in dividend and the remainder in remainder. Addressing mode of 16-bit numbers uses little endian.
| [in,out] | dividend | dividend and also quotient |
| [in] | divisor | divisor |
| [out] | remainder | remainder (wide as divisor) |
| macro inc16 | ( | address | ) |
Increments 16 bit number located in memory address starting from "destination".
| [in,out] | address | address to shift |
| macro mulAndAdd | ( | left | , |
| right | , | ||
| targetAddr | ) |
Multiplies left times right. Target value will be added to the value stored in targetAddr.
| [in] | left | first factor |
| [in] | dest | second factor |
| [in,out] | targetAddr | adding value and result |
| macro sub16 | ( | value | , |
| dest | ) |
Subtracts 16 bit number value from given memory cell specified by dest address and set result to dest.
| [in] | value | subtracting |
| [in,out] | dest | memory location for minuend and result |
| macro subMem16 | ( | source | , |
| destination | ) |
Subtracts value from "source" memory location from value in "destination" memory location.
| [in] | source | subtracting |
| [in,out] | dest | memory location for minuend and result |
| pseudocommand inc16 address |
Increments 16 bit number located in memory address starting from "destination".
| [in,out] | address | address to shift |
| pseudocommand dec16 destination |
Decrements 16 bit number located in memory address starting from "destination".
| [in,out] | address | address to shift |
| pseudocommand asl16 low |
Shifts left 2 byte number specified with "low" address. Carry flag indicates last bit that has been "shifted out".
MOD: A, C
| pseudocommand sub16 source |
Subtracts value from "source" memory location from value in "destination" memory location.
MOD: A, C