/* 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
rjmp 1b
/******************************************************************************/
-/* void cli_hexdump_block(const void* data, 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
.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
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
tst LENG_1
brne 7f
cp WIDTH, LENG_0
- breq 6f
- brcs 7f
+ brlo 7f
mov r22, LENG_0
6: inc r4
7:
pop DATA_0
pop INDENT
pop WIDTH
+simple_ret:
ret