diff --git a/src/crab/arm/block_data_transfer.cr b/src/crab/arm/block_data_transfer.cr index b4e63e0..c26f212 100644 --- a/src/crab/arm/block_data_transfer.cr +++ b/src/crab/arm/block_data_transfer.cr @@ -19,7 +19,7 @@ module ARM end end else - 16.times do |idx| + 15.downto(0).each do |idx| if bit?(list, idx) address &+= add ? 4 : -4 if pre_index @gba.bus[address] = @r[idx] diff --git a/src/crab/thumb/multiple_load_store.cr b/src/crab/thumb/multiple_load_store.cr index 5657521..d347429 100644 --- a/src/crab/thumb/multiple_load_store.cr +++ b/src/crab/thumb/multiple_load_store.cr @@ -12,7 +12,7 @@ module THUMB end end else # stmia - 8.times do |idx| + 7.downto(0).each do |idx| if bit?(list, idx) @gba.bus[address] = @r[idx] address &+= 4