ibmpc & Intel systems: Fix coverity identified issues
This commit is contained in:
parent
861d460ce5
commit
2ddb7162f3
3 changed files with 11 additions and 4749 deletions
|
@ -578,8 +578,8 @@ void set_cpuint(int32 int_num)
|
||||||
int32 sim_instr (void)
|
int32 sim_instr (void)
|
||||||
{
|
{
|
||||||
extern int32 sim_interval;
|
extern int32 sim_interval;
|
||||||
int32 IR, OP, DAR, reason, hi, lo, carry, i, adr;
|
int32 IR, OP, reason;
|
||||||
int32 MRR, REG, EA, MOD, RM, DISP, VAL, DATA, OFF, SEG, INC, VAL1, MAR;
|
int32 MRR, REG, EA, MOD, RM, VAL, DATA, OFF, SEG, INC, VAL1;
|
||||||
|
|
||||||
IP = saved_PC & ADDRMASK16; /* load local IP */
|
IP = saved_PC & ADDRMASK16; /* load local IP */
|
||||||
reason = 0; /* clear stop reason */
|
reason = 0; /* clear stop reason */
|
||||||
|
@ -3152,9 +3152,11 @@ int32 sim_instr (void)
|
||||||
case 4: //IP-INC16
|
case 4: //IP-INC16
|
||||||
sim_printf(" 0%04XH", EA);
|
sim_printf(" 0%04XH", EA);
|
||||||
break;
|
break;
|
||||||
|
/*
|
||||||
case 5: //MAR
|
case 5: //MAR
|
||||||
sim_printf(" 0%02XH", MAR);
|
sim_printf(" 0%02XH", MAR);
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4787,9 +4789,10 @@ t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
|
||||||
|
|
||||||
t_stat parse_sym (const char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
|
t_stat parse_sym (const char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
|
||||||
{
|
{
|
||||||
int32 cflag, i = 0, j, r, fflag = 1;
|
int32 cflag, i = 0, j, r;
|
||||||
char gbuf[CBUFSIZE];
|
char gbuf[CBUFSIZE];
|
||||||
|
|
||||||
|
memset (gbuf, 0, sizeof (gbuf));
|
||||||
cflag = (uptr == NULL) || (uptr == &i8088_unit);
|
cflag = (uptr == NULL) || (uptr == &i8088_unit);
|
||||||
while (isspace (*cptr)) cptr++; /* absorb spaces */
|
while (isspace (*cptr)) cptr++; /* absorb spaces */
|
||||||
if ((sw & SWMASK ('A')) || ((*cptr == '\'') && cptr++)) { /* ASCII char? */
|
if ((sw & SWMASK ('A')) || ((*cptr == '\'') && cptr++)) { /* ASCII char? */
|
||||||
|
@ -4807,7 +4810,7 @@ t_stat parse_sym (const char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32
|
||||||
or numeric (including spaces).
|
or numeric (including spaces).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (1) {
|
while (i < sizeof (gbuf) - 4) {
|
||||||
if (*cptr == ',' || *cptr == '\0' ||
|
if (*cptr == ',' || *cptr == '\0' ||
|
||||||
isdigit(*cptr))
|
isdigit(*cptr))
|
||||||
break;
|
break;
|
||||||
|
@ -4848,9 +4851,9 @@ t_stat parse_sym (const char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32
|
||||||
/* find opcode in table */
|
/* find opcode in table */
|
||||||
for (j = 0; j < 256; j++) {
|
for (j = 0; j < 256; j++) {
|
||||||
if (strcmp(gbuf, opcode[j]) == 0)
|
if (strcmp(gbuf, opcode[j]) == 0)
|
||||||
fflag = 0;
|
break;
|
||||||
}
|
}
|
||||||
if (fflag) /* not found */
|
if (j > 255) /* not found */
|
||||||
return SCPE_ARG;
|
return SCPE_ARG;
|
||||||
|
|
||||||
val[0] = j; /* store opcode */
|
val[0] = j; /* store opcode */
|
||||||
|
|
|
@ -1320,6 +1320,7 @@ t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32
|
||||||
int32 cflag, i = 0, j, r;
|
int32 cflag, i = 0, j, r;
|
||||||
char gbuf[CBUFSIZE];
|
char gbuf[CBUFSIZE];
|
||||||
|
|
||||||
|
memset (gbuf, 0, sizeof (gbuf));
|
||||||
cflag = (uptr == NULL) || (uptr == &i8080_unit);
|
cflag = (uptr == NULL) || (uptr == &i8080_unit);
|
||||||
while (isspace (*cptr)) cptr++; /* absorb spaces */
|
while (isspace (*cptr)) cptr++; /* absorb spaces */
|
||||||
if ((sw & SWMASK ('A')) || ((*cptr == '\'') && cptr++)) { /* ASCII char? */
|
if ((sw & SWMASK ('A')) || ((*cptr == '\'') && cptr++)) { /* ASCII char? */
|
||||||
|
@ -1337,7 +1338,7 @@ t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32
|
||||||
or numeric (including spaces).
|
or numeric (including spaces).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (1) {
|
while (i < sizeof (gbuf) - 4) {
|
||||||
if (*cptr == ',' || *cptr == '\0' ||
|
if (*cptr == ',' || *cptr == '\0' ||
|
||||||
isdigit(*cptr))
|
isdigit(*cptr))
|
||||||
break;
|
break;
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue