]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avr/utils.asm
* MMC/SD Bootloader support
[avrcpm.git] / avr / utils.asm
index 155c0274130b7c331a1a48adb37b0fa63c339fe8..685ce569622f2eaf2f01bc01f3ea84fdc2fd0d28 100644 (file)
@@ -202,6 +202,44 @@ printstr_end:
        pop     zh
        ret
        
+; ------------------------ String functions -------------------------
+;
+
+#if 0
+; String compare (z, y), one z-string in flash.
+
+strcmp_p:
+       lpm     _tmp0,z+
+       tst     _tmp0
+       breq    strcmp_pex
+
+       ld      temp, y+
+       lpm     _tmp0, z+
+       sub     temp,_tmp0
+       brne    strcmp_pex
+       tst     _tmp0
+       brne    strcmp_p
+strcmp_pex:
+       ret
+#endif
+
+; String compare (x, y, temp2). Max temp2 bytes are compared.
+
+strncmp_p:
+       subi    temp2,1
+       brcs    strncmp_peq
+       ld      temp,y+
+       lpm     _tmp0, z+
+       sub     temp,_tmp0
+       brne    strncmp_pex
+       tst     _tmp0
+       brne    strncmp_p
+strncmp_peq:
+       sub     temp,temp
+strncmp_pex:
+       ret
+
+
 ; --------------- Debugging stuff ---------------
 ; Print a line with the 8080/Z80 registers