dst1 = 11
.global bmw256
bmw256:
- push_range 2, 11
- stack_alloc_large 64+4
- adiw r30, 1
- movw ctx0, r30
- movw dst0, r24
- movw msg0, r22
- movw len0, r18
- movw len2, r20
- movw r24, ctx0
- rcall bmw256_init
-20:
- mov r18, len2
- or r18, len3
- breq 50f
- movw r24, ctx0
- movw r22, msg0
- rcall bmw_small_nextBlock
- ldi r20, 2
- sub len1, r20
- sbc len2, r1
- sbc len3, r1
- ldi r20, 64
- add msg0, r20
- adc msg1, r1
- rjmp 20b
-50:
- movw r24, ctx0
- movw r22, msg0
- movw r20, len0
- rcall bmw_small_lastBlock
- movw r24, dst0
- movw r22, ctx0
- rcall bmw256_ctx2hash
- stack_free_large 64+4
- pop_range 2, 11
- ret
-
+ push r16
+ ldi r16, 1
+ rjmp bmw_small_all
/*******************************************************************************
* void bmw224(void* dest, const void* msg, uint32_t length_b){
dst1 = 11
.global bmw224
bmw224:
+ push r16
+ clr r16
+
+bmw_small_all:
push_range 2, 11
stack_alloc_large 64+4
adiw r30, 1
movw len0, r18
movw len2, r20
movw r24, ctx0
- rcall bmw224_init
+ ldi r30, pm_lo8(init_lut)
+ ldi r31, pm_hi8(init_lut)
+ add r30, r16
+ adc r31, r1
+ icall
20:
mov r18, len2
or r18, len3
rcall bmw_small_lastBlock
movw r24, dst0
movw r22, ctx0
- rcall bmw224_ctx2hash
+ ldi r30, pm_lo8(c2h_lut)
+ ldi r31, pm_hi8(c2h_lut)
+ add r30, r16
+ adc r31, r1
+ icall
stack_free_large 64+4
pop_range 2, 11
+ pop r16
ret
+
+init_lut:
+ rjmp bmw224_init
+ rjmp bmw256_init
+c2h_lut:
+ rjmp bmw224_ctx2hash
+ rjmp bmw256_ctx2hash
* param cmdlist: r24:r25
*/
TMP_CNT_0 = 26
-TMP_CNT_1 = 27
+TMP_CNT_1 = 27
.global max_cmd_length
max_cmd_length:
movw r30, r24
brge 1b
movw r24, TMP_CNT_0
rjmp 1b
-
+
/******************************************************************************/
.global echo_ctrl
-echo_ctrl:
+echo_ctrl:
call strstrip
tst r24
brne 3f
cpi r20, 'n'
breq exit_1
cpi r20, 'f'
- breq exit_0
+ breq exit_0
ret
-exit_1:
+exit_1:
ldi r20, 1
rjmp exit
exit_0:
ldi r20, 0
-exit:
+exit:
sts cli_echo, r20
ret
print_echo_status:
clr r25
ldi r24, '\n'
rcall cli_putc
- ret
+ ret
pecho:
.asciz "\r\necho is o"
/******************************************************************************/
-/* int8_t search_and_call(char* cmd, uint16_t maxcmdlength, PGM_VOID_P cmdlist)
+/* int8_t search_and_call(char* cmd, uint16_t maxcmdlength, PGM_VOID_P cmdlist)
* param cmd: r24:r25
* param maxcmdlength: r22:r23
* param cmdlist: r20:r21
snc_auto_help:
movw r24, r22
movw r22, r20
- rcall cli_auto_help
+ rcall cli_auto_help
snc_return_1:
ldi r24, 1
rjmp snc_return
ldi r24, 2
snc_return:
clr r25
- ret
+ ret
.global search_and_call
search_and_call:
tst r18
brne 1f
2: rjmp snc_auto_help
-1:
+1:
push r28
push r29
push CMD_0
icall
ldi r24, 1
rjmp 5f
-4: ldi r24, 2
+4: ldi r24, 2
snc_return_0:
clr r24
5: pop LEN_1
* param cmdlist: r22:r23
*/
ITM_0 = 12
-ITM_1 = 13
+ITM_1 = 13
CMD_0 = 14
CMD_1 = 15
LEN_0 = 16
movw r24, ITM_0
rcall cli_putstr_P
rjmp 1b
-99:
+99:
ldi r24, lo8(prompt_str)
ldi r25, hi8(prompt_str)
rcall cli_putstr_P
pop_range 12, 17
ret
-prompt_str:
+prompt_str:
.asciz "\r\n>"
-itemprefix_str:
+itemprefix_str:
.asciz "\r\n "
/******************************************************************************/
*/
TMP_0 = 14
-TMP_1 = 15
+TMP_1 = 15
LEN_0 = 16
LEN_1 = 17
LST_0 = 28
lpm r25, Z+
movw r28, r30
adiw r24, 0
- breq 99f
+ breq 99f
movw TMP_0, r24
rcall cli_putstr_P
movw r24, TMP_0
brne 2b
4: ldi r24, lo8(sep_str)
ldi r25, hi8(sep_str)
+ rcall cli_putstr_P
ldi r22, lo8(none_str)
ldi r23, hi8(none_str)
- rcall cli_putstr_P
movw r30, r28
lpm r24, Z+
lpm r25, Z+
ldi r22, lo8(yes_str)
ldi r23, hi8(yes_str)
5: movw r24, r22
- rcall cli_putstr_P
+ rcall cli_putstr_P
ldi r24, lo8(sep2_str)
ldi r25, hi8(sep2_str)
rcall cli_putstr_P
rcall cli_putc
adiw r28, CMDLIST_ENTRY_SIZE-4
rjmp 1b
-99:
+99:
pop_range 28, 29
pop_range 14, 17
ret