From 88b76d2ff777839e88700dec0cc42f9cd49fb035 Mon Sep 17 00:00:00 2001 From: erikgoe Date: Sat, 9 Apr 2022 21:50:54 +0200 Subject: [PATCH] Fix sfr address check --- sim8051/src/Processor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim8051/src/Processor.cpp b/sim8051/src/Processor.cpp index b5bf7b6..e75b586 100644 --- a/sim8051/src/Processor.cpp +++ b/sim8051/src/Processor.cpp @@ -9,7 +9,7 @@ u8 &Processor::direct_acc( u8 addr ) { if ( addr < 0x80 ) { return iram[addr]; } else { - if ( std::find( valid_sfr_addresses.begin(), valid_sfr_addresses.end(), addr ) ) { + if ( std::find( valid_sfr_addresses.begin(), valid_sfr_addresses.end(), addr ) != valid_sfr_addresses.end() ) { return sfr[addr - 0x80]; } else { log( "Invalid access to sfr at address " + to_string( addr ) + ", PC: " + to_string( pc ) );