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