]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avr/utils.asm
Tag for Version 3.2
[avrcpm.git] / avr / utils.asm
index d8f881440ee57bc32ec13e68f04036f05e55eb7c..5ae5c1df71c42c9967078eb90883778cba68778e 100644 (file)
@@ -1,6 +1,6 @@
 ;    Print and Debug functions
 ;
-;    Copyright (C) 2010 Leo C.
+;    Copyright (C) 2010-2013 Leo C.
 ;
 ;    This file is part of avrcpm.
 ;
@@ -114,53 +114,13 @@ printhexn_isno:
 
 ; Prints a single space
 
-dbg_printspace:
-       ldi     temp,' '
-       rjmp    uartputc
-
-; Prints 16 bytes pointed to by Z in hex.
-
-dbg_hexdump_line:                      ;Address in z
-       push    temp2
+printspace:
        push    temp
-       printnewline
-       movw    temp,z                  ;Print address
-       rcall   printhexw
-       ldi     temp2,16                ;16 byte per line
-       rcall   dbg_printspace
-dbg_hdl1:
-       cpi     temp2,8
-       brne    PC+2
-       rcall   dbg_printspace
-       
-       rcall   dbg_printspace
-       ld      temp,z+
-       rcall   printhex
-       dec     temp2
-       brne    dbg_hdl1
-       sbiw    z,16
-       
-       rcall   dbg_printspace
-       rcall   dbg_printspace
-       ldi     temp2,16
-dbg_hdl2:
-       ld      temp,z+
-       cpi     temp,' '
-       brlo    dbg_hdpd
-       cpi     temp,0x7F
-       brlo    dbg_hdp
-dbg_hdpd:
-       ldi     temp,'.'
-dbg_hdp:
+       ldi     temp,' '
        rcall   uartputc
-       dec     temp2
-       brne    dbg_hdl2
-       sbiw    z,16
-       rcall   dbg_printspace
        pop     temp
-       pop     temp2
        ret
-       
+
 ;-----------------------------------------------------------------------
 ;Prints the zero-terminated string following the call statement. 
 
@@ -306,6 +266,53 @@ stack_search_found:
 
 
 
+;-----------------------------------------------------------------------
+; Prints 16 bytes RAM, pointed to by Z in hex.
+
+#if 0
+
+dbg_hexdump_line:                      ;Address in z
+       push    temp2
+       push    temp
+       printnewline
+       movw    temp,z                  ;Print address
+       rcall   printhexw
+       ldi     temp2,16                ;16 byte per line
+       rcall   printspace
+dbg_hdl1:
+       cpi     temp2,8
+       brne    PC+2
+       rcall   printspace
+       
+       rcall   printspace
+       ld      temp,z+
+       rcall   printhex
+       dec     temp2
+       brne    dbg_hdl1
+       sbiw    z,16
+       
+       rcall   printspace
+       rcall   printspace
+       ldi     temp2,16
+dbg_hdl2:
+       ld      temp,z+
+       cpi     temp,' '
+       brlo    dbg_hdpd
+       cpi     temp,0x7F
+       brlo    dbg_hdp
+dbg_hdpd:
+       ldi     temp,'.'
+dbg_hdp:
+       rcall   uartputc
+       dec     temp2
+       brne    dbg_hdl2
+       sbiw    z,16
+       rcall   printspace
+       pop     temp
+       pop     temp2
+       ret
+#endif
+       
 ;-----------------------------------------------------------------------
 ; Print a line with the 8080/Z80 registers