-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
793 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
; call commands | ||
|
||
shell_call_command_string: data.strz "call" | ||
shell_callref_command_string: data.strz "callref" | ||
|
||
shell_call_command: | ||
call shell_parse_arguments | ||
mov r1, 16 | ||
call string_to_int | ||
mov [shell_call_address], r0 | ||
|
||
mov r8, shell_batch_regs | ||
mov r0, [r8] | ||
mov r1, [r8+4] | ||
mov r2, [r8+8] | ||
mov r3, [r8+12] | ||
mov r4, [r8+16] | ||
mov r5, [r8+20] | ||
mov r6, [r8+24] | ||
mov r7, [r8+28] | ||
call [shell_call_address] | ||
mov r8, shell_batch_regs | ||
mov [r8], r0 | ||
mov [r8+4], r1 | ||
mov [r8+8], r2 | ||
mov [r8+12], r3 | ||
mov [r8+16], r4 | ||
mov [r8+20], r5 | ||
mov [r8+24], r6 | ||
mov [r8+28], r7 | ||
|
||
ret | ||
|
||
shell_callref_command: | ||
call shell_parse_arguments | ||
mov r1, 16 | ||
call string_to_int | ||
mov [shell_call_address], [r0] | ||
|
||
mov r8, shell_batch_regs | ||
mov r0, [r8] | ||
mov r1, [r8+4] | ||
mov r2, [r8+8] | ||
mov r3, [r8+12] | ||
mov r4, [r8+16] | ||
mov r5, [r8+20] | ||
mov r6, [r8+24] | ||
mov r7, [r8+28] | ||
call [shell_call_address] | ||
mov r8, shell_batch_regs | ||
mov [r8], r0 | ||
mov [r8+4], r1 | ||
mov [r8+8], r2 | ||
mov [r8+12], r3 | ||
mov [r8+16], r4 | ||
mov [r8+20], r5 | ||
mov [r8+24], r6 | ||
mov [r8+28], r7 | ||
|
||
ret | ||
|
||
shell_call_address: data.32 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
; cmp command | ||
|
||
shell_cmpreg_command_string: data.strz "cmpreg" | ||
shell_cmpimm_command_string: data.strz "cmpimm" | ||
|
||
shell_cmpreg_command: | ||
call shell_parse_arguments | ||
push r1 | ||
mov r1, 10 | ||
call string_to_int | ||
mov.8 [shell_cmpreg_command_reg1], r0 | ||
pop r0 | ||
mov r1, 10 | ||
call string_to_int | ||
mov.8 [shell_cmpreg_command_reg2], r0 | ||
|
||
movz.8 r0, [shell_cmpreg_command_reg1] | ||
mul r0, 4 | ||
add r0, shell_batch_regs | ||
mov r1, [r0] | ||
movz.8 r0, [shell_cmpreg_command_reg2] | ||
mul r0, 4 | ||
add r0, shell_batch_regs | ||
mov r2, [r0] | ||
|
||
cmp r1, r2 | ||
ifz mov [shell_command_return_value], 0 | ||
ifnz mov [shell_command_return_value], 1 | ||
|
||
ret | ||
|
||
shell_cmpimm_command: | ||
call shell_parse_arguments | ||
push r1 | ||
mov r1, 10 | ||
call string_to_int | ||
mov.8 [shell_cmpreg_command_reg1], r0 | ||
pop r0 | ||
mov r1, 16 | ||
call string_to_int | ||
mov [shell_cmpreg_command_imm], r0 | ||
|
||
movz.8 r0, [shell_cmpreg_command_reg1] | ||
mul r0, 4 | ||
add r0, shell_batch_regs | ||
mov r1, [r0] | ||
mov r2, [shell_cmpreg_command_imm] | ||
|
||
cmp r1, r2 | ||
ifz mov [shell_command_return_value], 0 | ||
ifnz mov [shell_command_return_value], 1 | ||
|
||
ret | ||
|
||
shell_cmpreg_command_reg1: data.8 0 | ||
shell_cmpreg_command_reg2: data.8 0 | ||
shell_cmpreg_command_imm: data.32 0 |
Oops, something went wrong.