![]() |
c128lib Base
Base macros for C128
|
Mem module. More...
Functions | |
macro | CopyFast (source, destination, count) |
This macro copies a block of memory from one location to another in a fast manner. | |
macro | CopyWithRelocation (source, destination) |
This macro copies a block of memory from one location to another using page relocation. | |
macro | CopyWithRelocationWithBank (source, sourceBank, destination, destinationBank) |
This macro copies a block of memory from one location to another using page relocation with bank selection. | |
macro | FillMemory (address, length, value) |
This macro fills memory with a specified value. | |
macro | Cmp16 (value, address) |
This macro compares a 16-bit value with a 16-bit memory location. | |
macro | Set8 (value, address) |
Variables | |
pseudocommand set8 | value |
Mem module.
Simple macros for memory operations.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
macro CopyFast | ( | source | , |
destination | , | ||
count | ) |
This macro copies a block of memory from one location to another in a fast manner.
It uses the 6502 assembly instructions 'lda' (load accumulator) and 'sta' (store accumulator) to perform the copy operation. This macro does not check for memory overlap between the source and destination. If the source and destination overlap, the behavior is undefined.
[in] | source | The starting address of the memory block to be copied. |
[in] | destination | The starting address of the location where the memory block will be copied to. |
[in] | count | The number of bytes to be copied. |
macro CopyWithRelocation | ( | source | , |
destination | ) |
This macro copies a block of memory from one location to another using page relocation.
This macro also handles the page relocation of the memory block during the copy operation. It's slower than
[in] | source | The starting address of the memory block to be copied. |
[in] | destination | The starting address of the location where the memory block will be copied to. |
macro CopyWithRelocationWithBank | ( | source | , |
sourceBank | , | ||
destination | , | ||
destinationBank | ) |
This macro copies a block of memory from one location to another using page relocation with bank selection.
This macro also handles the page relocation of the memory block during the copy operation. It's slower than
[in] | source | The starting address of the memory block to be copied. |
[in] | sourceBank | Bank of the starting address. |
[in] | destination | The starting address of the location where the memory block will be copied to. |
[in] | destinationBank | Bank of the destination address. |
macro FillMemory | ( | address | , |
length | , | ||
value | ) |
This macro fills memory with a specified value.
This macro fills memory starting from the specified address with the given value.
[in] | address | The starting address of memory. |
[in] | length | The memory length to be filled. |
[in] | value | The value to be filled on memory. |
macro Cmp16 | ( | value | , |
address | ) |
This macro compares a 16-bit value with a 16-bit memory location.
The macro first compares the low byte of the value with the low byte of the memory location, and if they are equal, it then compares the high byte of the value with the high byte of the memory location.
value | The 16-bit value to be compared. |
address | The starting address of the 16-bit memory location to be compared with. |
macro Set8 | ( | value | , |
address | ) |
pseudocommand set8 value |