CALL command

Added a CALL command to execute code at an arbitrary address.
This commit is contained in:
Peter Weingartner 2022-01-10 12:58:56 -05:00
parent 7b5dc563f7
commit 397e216ee5
10 changed files with 10469 additions and 10416 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -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 },

View file

@ -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;

View file

@ -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

File diff suppressed because it is too large Load diff

View file

@ -7,6 +7,6 @@
#define VER_MAJOR 0
#define VER_MINOR 2
#define VER_BUILD 1
#define VER_BUILD 2
#endif