Difference between revisions of "84PCE:Syscalls:0210DC"

From WikiTI
Jump to: navigation, search
(Created page with "MemClear MemClear 4C30 - MemClear == Synopsis == '''Offi...")
 
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:84PCE:Syscalls:By_Name:Memory|MemClear]]
+
[[Category:84PCE:Syscalls:By Name:Memory|MemClear]]
[[Category:84PCE:Syscalls:By_Name|MemClear]]
+
[[Category:84PCE:Syscalls:By Name|MemClear]]
[[Category:84PCE:Syscalls:By_Address|4C30 - MemClear]]
+
[[Category:84PCE:Syscalls:By Address|0210DC - MemClear]]
  
 
== Synopsis ==
 
== Synopsis ==
Line 18: Line 18:
  
 
=== Destroys ===
 
=== Destroys ===
* AF, BC, HL
+
* A = 0
 +
* 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 65536 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 also: [[84PCE:Syscalls:0210E0|MemSet]]''
  
 
== Example ==
 
== Example ==

Latest revision as of 03:43, 16 July 2016


Synopsis

Official Name: MemClear

Syscall Address: 0210DCh

Sets a block of memory to zero.

Inputs

  • HL: Address of memory block.
  • BC: Number of bytes to zero.

Outputs

  • DE: Points to byte after memory block.

Destroys

  • A = 0
  • 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: MemSet

Example

      ;Clear out pixelShadow
      ld     hl,pixelShadow
      ld     bc,8400
      call   _MemClear