Standard Library
Helper macros from asm/std.asm. Include them after cpu.asm/ext.asm to get simple data routines.
MEMCPY
- Syntax:
MEMCPY [dsthi:dstlo] [srchi:srclo] len - Inputs:
srchi:srclosource pointer,dsthi:dstlodestination pointer,lenstop value. - Behavior: Copies bytes from source to destination while an internal counter in
Awalks from0up tolen. That means it copieslen + 1bytes. Source and destination advance withINC16. Restores the originalAafter finishing. - Scratch: uses stack to save
A; flags fromCMP,INC,INC16.
STRCMP
- Syntax:
STRCMP i j srchi srclo dsthi dstlo - Inputs:
srchi:srclofirst string pointer,dsthi:dstlosecond string pointer. - Outputs:
ireceives0when strings match,1otherwise. - Behavior: Walks both zero-terminated strings byte-by-byte. Returns early on mismatch, or when a
0x00terminator is reached on both sides. - Scratch: uses
i,j, flags fromCMP,CMPI,JZR/JNZR, and increments addresses withINC16.