Commit d8cf3817 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Express wacky shifts as the ARMARM says we should

Reinstate the check that an immediate value that doesn't use the preferred encoding is disassembled to #value,ror such that reassembling it would give you back the original op code.
Tested with a handful of values, plus inspected all duplicates possible in Excel.

Version 1.96. Tagged as 'Debugger-1_96'
parent c8be9de2
File added
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.95"
Module_Version SETA 195
Module_MajorVersion SETS "1.96"
Module_Version SETA 196
Module_MinorVersion SETS ""
Module_Date SETS "24 Jul 2016"
Module_ApplicationDate SETS "24-Jul-16"
Module_ComponentName SETS "Debugger"
Module_ComponentPath SETS "castle/RiscOS/Sources/Programmer/Debugger"
Module_FullVersion SETS "1.95"
Module_HelpVersion SETS "1.95 (24 Jul 2016)"
Module_FullVersion SETS "1.96"
Module_HelpVersion SETS "1.96 (24 Jul 2016)"
END
/* (1.95)
/* (1.96)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.95
#define Module_MajorVersion_CMHG 1.96
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 24 Jul 2016
#define Module_MajorVersion "1.95"
#define Module_Version 195
#define Module_MajorVersion "1.96"
#define Module_Version 196
#define Module_MinorVersion ""
#define Module_Date "24 Jul 2016"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "Debugger"
#define Module_ComponentPath "castle/RiscOS/Sources/Programmer/Debugger"
#define Module_FullVersion "1.95"
#define Module_HelpVersion "1.95 (24 Jul 2016)"
#define Module_LibraryVersionInfo "1:95"
#define Module_FullVersion "1.96"
#define Module_HelpVersion "1.96 (24 Jul 2016)"
#define Module_LibraryVersionInfo "1:96"
......@@ -1258,11 +1258,22 @@ Immediate
BNE %FT10
TEQ r2, #0 ; but have a non-zero shift ?
BNE WackyShift
B %FT20 ; Unshifted 0-255
10
;Testing for weird shifts, ie representable numbers as <data><no shift> but are in fact <data><shift>
;removed
;Testing for weird shifts. There are 1023 duplicate immediates in total, of which 846 are >= 256.
;
;Since <data> is 8 bit, and <shift> is encoded divided by 2, there are at most 4 alternate encodings
;for any immediate before the <data> value encodes some completely different number.
;eg. <data << 0><lowest_shift+0> 1 ROR 24 = 256
; <data << 2><lowest_shift+1> 4 ROR 26 = 256
; <data << 4><lowest_shift+2> 16 ROR 28 = 256
; <data << 6><lowest_shift+3> 64 ROR 30 = 256
;
;The <lowest_shift> is the preferred one per DDI 0406C, A5.2.4, so that's the one
;whose <data> has at least one of bits 0-2 set.
TST r4, #3
BEQ WackyShift
20
CMPS r8, #10
BLO Rem_Number ; If really simple, just display number
; ie. 0..9 unambiguous
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment