Clean up RED/YELLOW logging
This commit is contained in:
parent
62150f45de
commit
ff2d6b6de4
1 changed files with 4 additions and 5 deletions
|
@ -626,17 +626,16 @@ class PDP11:
|
||||||
# (as defined by hardware book)
|
# (as defined by hardware book)
|
||||||
lim = self.stack_limit_register or 0o400
|
lim = self.stack_limit_register or 0o400
|
||||||
if self.r[self.SP] < lim:
|
if self.r[self.SP] < lim:
|
||||||
if not (self.straps & self.STRAPBITS.YELLOW):
|
mstr = self.machinestate(fmt=oct)
|
||||||
self.logger.info(f"YELLOW ZONE, {list(map(oct, self.r))}")
|
if self.r[self.SP] + 32 < lim: # is it red?
|
||||||
|
|
||||||
# how about red?
|
|
||||||
if self.r[self.SP] + 32 < lim: # uh oh - below the yellow!
|
|
||||||
# this is a red zone trap which is immediate
|
# this is a red zone trap which is immediate
|
||||||
# the stack pointer is set to location 4
|
# the stack pointer is set to location 4
|
||||||
# and this trap is executed
|
# and this trap is executed
|
||||||
self.r[self.SP] = 4 # !! just enough room for...
|
self.r[self.SP] = 4 # !! just enough room for...
|
||||||
|
self.logger.warning(f"RED ZONE, {mstr}")
|
||||||
raise PDPTraps.AddressError(cpuerr=self.CPUERR_BITS.REDZONE)
|
raise PDPTraps.AddressError(cpuerr=self.CPUERR_BITS.REDZONE)
|
||||||
else:
|
else:
|
||||||
|
self.logger.info(f"YELLOW ZONE, {mstr}")
|
||||||
self.straps |= self.STRAPBITS.YELLOW
|
self.straps |= self.STRAPBITS.YELLOW
|
||||||
|
|
||||||
def get_synchronous_trap(self, abort_trap):
|
def get_synchronous_trap(self, abort_trap):
|
||||||
|
|
Loading…
Add table
Reference in a new issue