;Print a unsigned lonng value to the uart
-; temp4:temp3:temp2:temp = value
+; r15:r14:temp2:temp = value
print_ultoa:
push yh
push yl
push z_flags
- push temp4
- push temp3
+ push r15
+ push r14
push temp2
push temp
clr yl ;yl = stack level
-ultoa1: ldi z_flags, 32 ;yh = temp4:temp % 10
- clr yh ;temp4:temp /= 10
+ultoa1: ldi z_flags, 32 ;yh = r15:temp % 10
+ clr yh ;r15:temp /= 10
ultoa2: lsl temp
rol temp2
- rol temp3
- rol temp4
+ rol r14
+ rol r15
rol yh
cpi yh,10
brcs ultoa3
subi yh, -'0'
push yh ;Stack it
inc yl
- cp temp,_0 ;Repeat until temp4:temp gets zero
+ cp temp,_0 ;Repeat until r15:temp gets zero
cpc temp2,_0
- cpc temp3,_0
- cpc temp4,_0
+ cpc r14,_0
+ cpc r15,_0
brne ultoa1
ldi temp, '0'
pop temp
pop temp2
- pop temp3
- pop temp4
+ pop r14
+ pop r15
pop z_flags
pop yl
pop yh
mov temp,z_a
rcall printhex
printstring " BC ="
+#if 1
+ movw temp,z_c
+#else
ldd temp2,y+oz_b
ldd temp,y+oz_c
+#endif
rcall printhexw
printstring " DE ="
+#if 1
+ movw temp,z_e
+#else
ldd temp2,y+oz_d
ldd temp,y+oz_e
+#endif
rcall printhexw
printstring " HL ="
- ldd temp2,y+oz_h
+#if 1
+ movw temp,z_l
+#else
ldd temp,y+oz_l
+ ldd temp2,y+oz_h
+#endif
rcall printhexw
printstring " SP="
movw temp, z_spl