]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/cli-hexdump.S
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / test_src / cli-hexdump.S
index ce151b9cc4773a5b6d4cfdfb09f01450cf6eb462..d071a0031126720a1d83597c2edf2c1de2413e05 100644 (file)
@@ -1,7 +1,7 @@
 /* cli-hexdump.S */
 /*
     This file is part of the AVR-Huffman.
-    Copyright (C) 2009  Daniel Otte (daniel.otte@rub.de)
+    Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -127,7 +127,7 @@ cli_hexdump2:
        rjmp 1b
 
 /******************************************************************************/
-/* void cli_hexdump_block(const voiddata, uint16_t length, uint8_t indent, uint8_t width)
+/* void cli_hexdump_block(const void *data, uint16_t length, uint8_t indent, uint8_t width)
  *   param data:     r24:r25
  *   param length:   r22:r23
  *   param indent:   r20
@@ -142,11 +142,9 @@ LENG_1 = 17
 
 .global cli_hexdump_block
 cli_hexdump_block:
-       tst r22
-       brne 1f
-       tst r23
-       brne 1f
-       ret
+       movw r26, r22
+       adiw r26, 0
+       breq simple_ret
 1:
        push WIDTH
        push INDENT
@@ -160,16 +158,16 @@ cli_hexdump_block:
        movw DATA_0, r24
        movw LENG_0, r22
 2:
-       clr r25
+;      clr r25
        ldi r24, '\r'
        rcall cli_putc
-       clr r25
+;      clr r25
        ldi r24, '\n'
        rcall cli_putc
        mov r4, INDENT
        tst r4
        breq 4f
-3:     clr r25
+3:;    clr r25
        ldi r24, ' '
        rcall cli_putc
        dec r4
@@ -181,8 +179,7 @@ cli_hexdump_block:
        tst LENG_1
        brne 7f
        cp WIDTH, LENG_0
-       breq 6f
-       brcs 7f
+       brlo 7f
        mov r22, LENG_0
 6:     inc r4
 7:
@@ -200,6 +197,7 @@ cli_hexdump_block:
        pop DATA_0
        pop INDENT
        pop WIDTH
+simple_ret:
        ret