From 44e8b5b8824cb73145d97a5bb79cf574a905ca8f Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:12:17 -0300 Subject: [PATCH] fix: force-align ARM STRH reads --- src/cpu/arm/half_signed_data_transfer.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/arm/half_signed_data_transfer.zig b/src/cpu/arm/half_signed_data_transfer.zig index e30570a..6e3bf86 100644 --- a/src/cpu/arm/half_signed_data_transfer.zig +++ b/src/cpu/arm/half_signed_data_transfer.zig @@ -58,7 +58,7 @@ pub fn halfAndSignedDataTransfer(comptime P: bool, comptime U: bool, comptime I: } else { if (opcode >> 5 & 0x01 == 0x01) { // STRH - bus.write16(address, @truncate(u16, cpu.r[rd])); + bus.write16(address & 0xFFFF_FFFE, @truncate(u16, cpu.r[rd])); } else unreachable; // SWP }