diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index fc747e0c4..08c0681d9 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -95,6 +95,7 @@ struct Registers { }; struct Memory { enum class Tag { + Seeded, Accessed, FlagsL, FlagsH @@ -112,6 +113,11 @@ struct Memory { tags.clear(); } + void seed(uint32_t address, uint8_t value) { + memory[address] = value; + tags[address] = Tag::Seeded; + } + // Entry point used by the flow controller so that it can mark up locations at which the flags were written, // so that defined-flag-only masks can be applied while verifying RAM contents. template IntT &access([[maybe_unused]] InstructionSet::x86::Source segment, uint16_t address, Tag tag) { @@ -136,6 +142,9 @@ struct Memory { // Entry point for the 8086; simply notes that memory was accessed. template IntT &access([[maybe_unused]] InstructionSet::x86::Source segment, uint32_t address) { + if(tags.find(address) == tags.end()) { + printf("Access to uninitialised RAM area"); + } return access(segment, address, Tag::Accessed); } }; @@ -399,7 +408,7 @@ struct FailedExecution { NSDictionary *const initial_state = test[@"initial"]; InstructionSet::x86::Status initial_status; for(NSArray *ram in initial_state[@"ram"]) { - execution_support.memory.memory[[ram[0] intValue]] = [ram[1] intValue]; + execution_support.memory.seed([ram[0] intValue], [ram[1] intValue]); } [self populate:execution_support.registers status:initial_status value:initial_state[@"regs"]]; execution_support.status = initial_status;