1
0
mirror of https://github.com/simh/simh.git synced 2026-01-28 12:49:21 +00:00

simulators with global variables PC, SP and BC: Avoid name space collisions.

Avoid potential name space collision for the global variables PC, SP and BC
when readline is dynamically loaded.  For some unknown reason, ncurses
exports these internal variables which may be needed in the context of
how ncurses is used by readline implementations.  In any case, these
variable names are common in simulators, so there is an undesired
interaction between simulator internal variables and the simplest
solution is to rename these simulator global variables where they exist.
Another alternative is to merely declare these variables static when
they happen to only be referenced in a single simulator source module.
This commit is contained in:
Peter Kooiman
2025-04-09 13:56:27 -10:00
committed by Mark Pizzolato
parent dab8053cf8
commit ef8f4f53a2
8 changed files with 3559 additions and 3540 deletions

View File

@@ -180,10 +180,10 @@ typedef struct {
/* storage for the rest of the registers */
uint32 PSW = 0; /* program status word */
uint32 A = 0; /* accumulator */
uint32 BC = 0; /* BC register pair */
static uint32 BC = 0; /* BC register pair */
uint32 DE = 0; /* DE register pair */
uint32 HL = 0; /* HL register pair */
uint32 SP = 0; /* Stack pointer */
static uint32 SP = 0; /* Stack pointer */
uint32 saved_PC = 0; /* program counter */
uint32 IM = 0; /* Interrupt Mask Register */
uint8 xack = 0; /* XACK signal */
@@ -191,7 +191,7 @@ uint32 int_req = 0; /* Interrupt request */
uint8 INTA = 0; // interrupt acknowledge
uint16 PCX; /* External view of PC */
uint16 PCY; /* Internal view of PC */
uint16 PC;
static uint16 PC;
UNIT *uptr;
uint16 port; //port used in any IN/OUT
uint16 addr; //addr used for operand fetch

File diff suppressed because it is too large Load Diff