summaryrefslogtreecommitdiff
path: root/home/compare.asm
diff options
context:
space:
mode:
Diffstat (limited to 'home/compare.asm')
-rw-r--r--home/compare.asm11
1 files changed, 11 insertions, 0 deletions
diff --git a/home/compare.asm b/home/compare.asm
new file mode 100644
index 00000000..e2da7857
--- /dev/null
+++ b/home/compare.asm
@@ -0,0 +1,11 @@
+; Compare strings, c bytes in length, at de and hl.
+; Often used to compare big endian numbers in battle calculations.
+StringCmp::
+ ld a, [de]
+ cp [hl]
+ ret nz
+ inc de
+ inc hl
+ dec c
+ jr nz, StringCmp
+ ret