Fix some bugs and compiler warnings

This commit is contained in:
Ada Gottensträter 2022-03-29 19:45:31 +02:00
parent 154d880a27
commit 6b3f7c1a6a
5 changed files with 11 additions and 11 deletions

View File

@ -24,7 +24,7 @@ extern int32_t baudrate;
extern int32_t eeprom; extern int32_t eeprom;
extern char *hubram; extern char *hubram;
extern int32_t printbreak; extern int32_t printbreak;
extern PasmVarsT PasmVars[8]; extern PasmVarsT PasmVars[16];
extern SerialT serial_in; extern SerialT serial_in;
extern SerialT serial_out; extern SerialT serial_out;

2
gdb.c
View File

@ -19,7 +19,7 @@
extern FILE *logfile; extern FILE *logfile;
extern FILE *tracefile; extern FILE *tracefile;
extern FILE *cmdfile; extern FILE *cmdfile;
extern PasmVarsT PasmVars[8]; extern PasmVarsT PasmVars[16];
extern char *hubram; extern char *hubram;
char cmd[1028]; char cmd[1028];
extern int32_t profile; extern int32_t profile;

View File

@ -11,7 +11,7 @@ extern char *hubram;
extern int32_t memsize; extern int32_t memsize;
extern char lockstate[16]; extern char lockstate[16];
extern char lockalloc[16]; extern char lockalloc[16];
extern PasmVarsT PasmVars[8]; extern PasmVarsT PasmVars[16];
extern int32_t pasmspin; extern int32_t pasmspin;
extern int32_t cycleaccurate; extern int32_t cycleaccurate;
extern int32_t loopcount; extern int32_t loopcount;

View File

@ -56,12 +56,12 @@ static int wrl_flags1 = 0;
static int rdl_flags0 = 0; static int rdl_flags0 = 0;
static int rdl_flags1 = 0; static int rdl_flags1 = 0;
char *GetOpname2(unsigned int, int *, int *, int *); char *GetOpname2(unsigned int, int *, int *, int *, int);
static void NotImplemented(int instruction) static void NotImplemented(int instruction)
{ {
int dummy; int dummy;
char *opname = GetOpname2(instruction, &dummy, &dummy, &dummy); char *opname = GetOpname2(instruction, &dummy, &dummy, &dummy,0);
printf("%s%s not implemented - %8.8x%s", NEW_LINE, opname, instruction, NEW_LINE); printf("%s%s not implemented - %8.8x%s", NEW_LINE, opname, instruction, NEW_LINE);
spinsim_exit(1); spinsim_exit(1);
} }
@ -2641,13 +2641,13 @@ int32_t ExecutePasmInstruction2(PasmVarsT *pasmvars)
if (value2 >= 0xfff80 && value2 < 0xfffc0) if (value2 >= 0xfff80 && value2 < 0xfffc0)
wrl_flags0 |= 1 << ((value2 >> 2) & 15); wrl_flags0 |= 1 << ((value2 >> 2) & 15);
result = read_unaligned_long(value2); result = read_unaligned_long(value2);
if ((value1 & 0xff) != 0xff) if (value1 & 0xff)
result = (result & ~0xff) | (value1 & 0xff); result = (result & ~0xff) | (value1 & 0xff);
if ((value1 & 0xff) != 0xff00) if (value1 & 0xff00)
result = (result & ~0xff00) | (value1 & 0xff00); result = (result & ~0xff00) | (value1 & 0xff00);
if ((value1 & 0xff) != 0xff0000) if (value1 & 0xff0000)
result = (result & ~0xff0000) | (value1 & 0xff0000); result = (result & ~0xff0000) | (value1 & 0xff0000);
if ((value1 & 0xff) != 0xff000000) if (value1 & 0xff000000)
result = (result & ~0xff000000) | (value1 & 0xff000000); result = (result & ~0xff000000) | (value1 & 0xff000000);
write_unaligned_long(value2, result); write_unaligned_long(value2, result);
if (pasmvars->printflag > 1) if (pasmvars->printflag > 1)
@ -3618,7 +3618,7 @@ int32_t ExecutePasmInstruction2(PasmVarsT *pasmvars)
case 43: // pop case 43: // pop
pasmvars->retptr = (pasmvars->retptr - 1) & 7; pasmvars->retptr = (pasmvars->retptr - 1) & 7;
pasmvars->retstack[pasmvars->retptr] = value1; result = pasmvars->retstack[pasmvars->retptr];
if (pasmvars->retptr == 7) if (pasmvars->retptr == 7)
printf("return stack underflow%s", NEW_LINE); printf("return stack underflow%s", NEW_LINE);
break; break;

View File

@ -14,7 +14,7 @@
#include "spinsim.h" #include "spinsim.h"
extern int32_t printflag; extern int32_t printflag;
extern PasmVarsT PasmVars[8]; extern PasmVarsT PasmVars[16];
extern char *hubram; extern char *hubram;
extern int32_t memsize; extern int32_t memsize;
extern int32_t loopcount; extern int32_t loopcount;