1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 03:29:45 +00:00

Fix immediate offset and data processing operation.

This commit is contained in:
Thomas Harte 2024-03-02 23:27:37 -05:00
parent 62da0dee7f
commit 99f0233b76
2 changed files with 3 additions and 3 deletions

View File

@ -142,7 +142,7 @@ struct DataProcessingFlags {
/// @returns The operation to apply.
constexpr DataProcessingOperation operation() const {
return DataProcessingOperation((flags_ >> 21) & 0xf);
return DataProcessingOperation((flags_ >> (21 - FlagsStartBit)) & 0xf);
}
/// @returns @c true if operand 2 is defined by the @c rotate() and @c immediate() fields;
@ -232,7 +232,7 @@ struct SingleDataTransferFlags {
return flag_bit<20>(flags_) ? Operation::LDR : Operation::STR;
}
constexpr bool offset_is_immediate() const { return flag_bit<25>(flags_); }
constexpr bool offset_is_immediate() const { return !flag_bit<25>(flags_); }
constexpr bool pre_index() const { return flag_bit<24>(flags_); }
constexpr bool add_offset() const { return flag_bit<23>(flags_); }
constexpr bool transfer_byte() const { return flag_bit<22>(flags_); }

View File

@ -203,7 +203,7 @@ struct Memory {
executor.bus_.rom = roms.find(rom_name)->second;
uint32_t pc = 0;
for(int c = 0; c < 100; c++) {
for(int c = 0; c < 200; c++) {
uint32_t instruction;
executor.bus_.read(pc, instruction, executor.mode(), false);