CALL command
Added a CALL command to execute code at an arbitrary address.
This commit is contained in:
parent
7b5dc563f7
commit
397e216ee5
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/bin/archive/foenixmcp_flash_20220110_01.bin
Normal file
BIN
src/bin/archive/foenixmcp_flash_20220110_01.bin
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -56,6 +56,7 @@ short g_current_channel = 0;
|
|||
const t_cli_command g_cli_commands[] = {
|
||||
{ "?", "? : print this helpful message", cmd_help },
|
||||
{ "HELP", "HELP : print this helpful message", cmd_help },
|
||||
{ "CALL", "CALL <address> : execute code in supervisor mode at <address> ", mem_cmd_call },
|
||||
{ "CD", "CD <path> : sets the current directory", cmd_cd },
|
||||
{ "CLS", "CLS : clear the screen", cmd_cls },
|
||||
{ "COPY", "COPY <src path> <dst path> : Copies files to destination", cmd_copy },
|
||||
|
|
|
@ -38,6 +38,30 @@ short mem_cmd_dump(short channel, int argc, const char * argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Pointer to a function taking void and returning void */
|
||||
typedef void (*p_thunk)();
|
||||
|
||||
void test_thunk() {
|
||||
log(LOG_ERROR, "CALL is working.");
|
||||
}
|
||||
|
||||
/*
|
||||
* Command to start execution in supervisor mode at a location in memory:
|
||||
*
|
||||
* CALL <address>
|
||||
*/
|
||||
short mem_cmd_call(short channel, int argc, const char * argv[]) {
|
||||
p_thunk thunk = 0;
|
||||
TRACE ("mem_cmd_call");
|
||||
|
||||
thunk = (p_thunk)cli_eval_number(argv[1]);
|
||||
if (thunk) {
|
||||
thunk();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
short mem_cmd_dasm(short channel, int argc, const char * argv[]) {
|
||||
unsigned long address = 0;
|
||||
long count = 1000;
|
||||
|
|
|
@ -7,6 +7,13 @@
|
|||
|
||||
#include "dis68k.h"
|
||||
|
||||
/*
|
||||
* Command to start execution in supervisor mode at a location in memory:
|
||||
*
|
||||
* CALL <address>
|
||||
*/
|
||||
extern short mem_cmd_call(short channel, int argc, const char * argv[]);
|
||||
|
||||
/*
|
||||
* Print out the contents of a block of memory
|
||||
*
|
||||
|
|
17586
src/mapfile
17586
src/mapfile
File diff suppressed because it is too large
Load diff
|
@ -7,6 +7,6 @@
|
|||
|
||||
#define VER_MAJOR 0
|
||||
#define VER_MINOR 2
|
||||
#define VER_BUILD 1
|
||||
#define VER_BUILD 2
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue