Difference between revisions of "84PCE:Syscalls:0210E0"
From WikiTI
(→Comments) |
(→Destroys) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:84PCE:Syscalls: | + | [[Category:84PCE:Syscalls:By Name:Memory|MemSet]] |
− | [[Category:84PCE:Syscalls: | + | [[Category:84PCE:Syscalls:By Name|MemSet]] |
− | [[Category:84PCE:Syscalls: | + | [[Category:84PCE:Syscalls:By Address|0210E0 - MemSet]] |
== Synopsis == | == Synopsis == | ||
Line 19: | Line 19: | ||
=== Destroys === | === Destroys === | ||
− | * | + | * HL = HL+BC |
+ | * DE = HL+1+BC | ||
+ | * BC = 0 | ||
== Comments == | == Comments == | ||
This routine uses an LDIR instruction to clear the memory block, so do not pass it a block length of 0 or 1 or it will erase 16777216 bytes. | This routine uses an LDIR instruction to clear the memory block, so do not pass it a block length of 0 or 1 or it will erase 16777216 bytes. | ||
− | ''See | + | ''See also: [[84PCE:Syscalls:0210DC|MemClear]]'' |
== Example == | == Example == |
Latest revision as of 02:45, 16 July 2016
Synopsis
Official Name: MemSet
Syscall Address: 0210E0h
Sets a block of memory to the value in A.
Inputs
- HL: Address of memory block.
- BC: Number of bytes to zero.
- A: Value to set memory block to.
Outputs
- DE: Points to byte after memory block.
Destroys
- HL = HL+BC
- DE = HL+1+BC
- BC = 0
Comments
This routine uses an LDIR instruction to clear the memory block, so do not pass it a block length of 0 or 1 or it will erase 16777216 bytes.
See also: MemClear
Example
;Clear out pixelShadow with spaces ld a,' ' ld hl,pixelShadow ld bc,8400 call _MemSet