aboutsummaryrefslogtreecommitdiff
path: root/utils.gbasm
diff options
context:
space:
mode:
Diffstat (limited to 'utils.gbasm')
-rw-r--r--utils.gbasm15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils.gbasm b/utils.gbasm
index fe03152..ba808bd 100644
--- a/utils.gbasm
+++ b/utils.gbasm
@@ -217,6 +217,21 @@ Print_str: ; Memory Tilemap position in HL, Text address in BC, FF ended
POP AF
RET
+strlen: ; Text address in HL, FF ended. Result in A
+ PUSH HL
+ PUSH BC
+ .loop:
+ LD A, (HL+)
+ CP $FF
+ JR Z, =.end
+ INC B
+ JR =.loop
+ .end:
+ LD A, B
+ POP BC
+ POP HL
+ RET
+
MUL: ; B x C => EA
XOR A
LD E, $00