Commit Graph

1171 Commits

Author SHA1 Message Date
emteere
3736ae076c GP-3532 Minor 68000 function start pattern 2023-06-13 23:06:18 +00:00
ghidra1
5970699db1 Merge remote-tracking branch
'origin/GP-2955_ghidorahrex_PR-4795_Phlosioneer_m68k-pea-fix' into patch
(Closes #4795)
2023-06-12 20:19:58 -04:00
ghidra1
d5db5b643a Merge remote-tracking branch
'origin/GP-2779_ghidorahrex_PR-4808_Phlosioneer_m68k-movem-pc-fix' into
patch (Closes #4807, Closes #4808)
2023-06-12 20:17:06 -04:00
ghidra1
de6ff8440d Merge remote-tracking branch 'origin/GP-3478_ghidorahrex_aarch64_neon_mla_fix' into patch 2023-06-12 20:11:31 -04:00
ghidra1
6269f69c76 Merge remote-tracking branch
'origin/GP-2963_Ghidorahrex_PR-4838_c64cryptoboy_fix-6502-tsx' into
patch (Closes #4838)
2023-06-12 20:05:39 -04:00
ghidra1
de1071846a Merge remote-tracking branch
'origin/GP-3009_ghidorahrex_PR-4825_fenugrec_8048_allfixes' into patch
(Closes #2423, Closes #4825)
2023-06-12 19:59:41 -04:00
emteere
164ed51304 GP-3532 Reverted 68000 register calling convention change, added new
68000_register cspec.  Added function start patterns
2023-06-12 20:58:20 +00:00
emteere
ca697fcaaf GP-3009 Setting of context for correct disassembly in either bank. Set
Ports to volatile so they aren't simplified away in the decompiler.
2023-06-08 18:50:04 +00:00
Ryan Kurtz
bf3e3923e8 Merge remote-tracking branch 'origin/GP-3480_PPCSmallDataAreaPointer' into patch 2023-06-01 06:12:52 -04:00
Ryan Kurtz
e3429a57db Merge remote-tracking branch
'origin/GP-3102_ghidorahrex_x86-64_popf_pushf--SQUASHED' into patch
(Closes #4980)
2023-05-31 11:20:14 -04:00
Phlosioneer
058fa90387 Issue 4807 Fix movem PC instruction bug on 68000
The `movem` instruction's `(d16, PC)` addressing mode has an instruction
word, a mask word, and then an extension word. The addressing mode
uses the value of PC incremented to the extension word, in this case
`instr_start + 4`. The sleigh code incorrectly uses `instr_start + 2`.
The issue is present for both `movem.w` and `movem.l` variants. This
PR fixes the `PC` offset to `+4`.

See 68000 reference manual page 2-13 for PC indirect addressing mode,
and 4-128 for MOVEM documentation.

Partially addresses #4807.
2023-05-31 14:31:37 +00:00
ghidorahrex
af40b28931 GP-3102: Fixed disasm of default 64-bit addrsize instructions 2023-05-31 10:13:41 -04:00
ghidorahrex
70a50dfcc2 GP-3478: Fixed registers in aarch64 neon mla instruction 2023-05-31 14:08:47 +00:00
David Youd
2d497a0d5c fix to TSX instruction 2023-05-31 13:14:48 +00:00
fenugrec
2b05e1f5f2 8048 : improve display of JBx opcode
instead of e.g. "JB0x5", they will render as "JB5".
2023-05-31 12:34:24 +00:00
fenugrec
bb08f67417 8048: fix JMPP @A extra dereference
JMPP was doing two indirections : one in PData and then one again in
AddrInd, where there should only be one.

MCS-48 docs :

> The contents of the Program Memory location addressed by the
Accumulator
is used as the new page offset of the Program Counter.

i.e.
(PC 0 – 7) <- ((A))

Previous implementation caused disasm / decompiler errors such as
"Low-level Error: Could not find op at target address"

refs:
https://github.com/NationalSecurityAgency/ghidra/discussions/4818
2023-05-31 12:34:23 +00:00
fenugrec
97b0984426 8048: support > 4kB address space
MCS-48 just barely supports 12 bits of program counter space (4kB), but
many real-world applications use software banking to expand this,
e.g. via IO pins driving extra address lines to the external ROM.

This patch allows up to 16-bit addresses. To use this feature, simply
select the special instruction (typically ORL Pp or ANL Pp) and set a
manual Fallthrough address to the correct bank.
2023-05-31 12:34:22 +00:00
fenugrec
3fbf16b056 8048: make DBF a context register
See GH #2423

The SEL MB0/MB1 opcodes set a DBF register but this had no effect, therefore JMP and CALL
destinations didn't take into account DBF.
This is essentially @esaulenka 's patch from
3756e1bcee

but separated from the DFB->DBF typo change, and sets the width of the new
context register to be 1 bit (doesn't need to be 2 bits)

This greatly improves analysis. The only downside is that to manually
override DBF on a single instruction, it needs to be cleared first, then
disassembled again after setting the desired DBF.
2023-05-31 12:34:21 +00:00
fenugrec
7c2b8ca27d 8048: typo in "DFB" register name , should be DBF
MCS-48 Assembly language manual #9800255D :
'
DBF designate memory bank flip-flop
'
2023-05-31 12:34:20 +00:00
fenugrec
5ea567f65b 8048: fix movp, movp3, jmpp
the correct syntax for [x,y] bitranges has y= # number of bits. These
three instructions affect the lower 8 bits of PC, not 7.

From MCS-48 docs:
'
MOVP A,@A
(PC: 0-7)<-(A)
(A)<-((PC))

Move data in program memory location addressed by A into A. Program
counter is restored.
'

There is similar wording for MOVP3 and JMPP.

Fixes #4810 on GH
2023-05-31 12:34:19 +00:00
Phlosioneer
b1c54e36e1 Fix pea SP instruction bug on 68000 processor
The `pea` instruction adjusts `SP`, but the address may be `SP`-based.
Ghidra was evaluating the effective address after adjusting `SP`, but
the address should be evaluated before `SP` is changed. For example,
`pea (SP)` should result in a pointer to the previous stack entry,
rather than a pointer to itself.
2023-05-30 16:49:29 +00:00
caheckman
ce520cc940 GP-3480 Mark PPC r13 as unaffected 2023-05-24 14:35:59 -04:00
ghidra1
584260ca81 GP-3472 Added __stdcall convention alias for 64-bit Windows cspecs 2023-05-23 15:34:35 -04:00
Ryan Kurtz
0cae3ab0f5 Merge remote-tracking branch
'origin/GP-3325_ghidorahrex_PR-4886_Ninja3047_fix-ppc-stmvsprw' into
patch (Closes #4886)
2023-05-18 11:02:54 -04:00
Ryan Kurtz
f8ebb729ef Merge remote-tracking branch
'origin/GP-3432_ghidorahrex_PR-4887_Ninja3047_ppc_vle_eieio' into patch
(Closes #4887)
2023-05-18 10:58:25 -04:00
ghidra1
4b7188c3e4 Merge remote-tracking branch
'origin/GP-3398_ghidorahrex_PR-1723_saruman9_fix_call_with_segment_reg'
into Ghidra_10.3 (Closes #1715, Closes #1723)
2023-05-08 14:54:47 -04:00
ghidra1
d8d5817d7e Merge remote-tracking branch
'origin/GP-3326_ghidorahrex_PR-5194_edmcman_coldfire_halt_decode' into
Ghidra_10.3 (Closes #5194)
2023-05-08 14:19:12 -04:00
ghidra1
ff8f0d7782 Merge remote-tracking branch
'origin/GP-3341_ghidorahrex_ppc_branch_link_fix' into Ghidra_10.3
(Closes #5218)
2023-05-08 14:16:50 -04:00
William Tan
9c694ebfd1
move around mbar/eieio 2023-05-05 11:13:03 -04:00
William Tan
eebdca2668
move mbar from a2 to ppc_embedded, remove duplicate eieio 2023-05-05 11:13:03 -04:00
William Tan
8277a6312b
fix: also decode eieio (mbar 0) for VLE 2023-05-05 11:13:02 -04:00
saruman9
1402d0dc61 [x86] Align stack while Far Call
Push CS register onto the stack according to operand and address sizes.

Fix #1715.
2023-05-05 12:58:48 +00:00
ghidorahrex
1df6c993b9 GP-3372: Reverted x86 66 90 bytes back to nop 2023-05-01 16:01:42 +00:00
Ryan Kurtz
07fc63f99f GP-2257: Fixing Processor BPF ldef issue 2023-05-01 08:07:32 -04:00
Ryan Kurtz
7fa3389119 GP-2974: Fixing warnings 2023-05-01 07:23:48 -04:00
Ryan Kurtz
70405b07b0 GP-2257: Fixing compilation error 2023-05-01 06:54:27 -04:00
Ryan Kurtz
7511825043 Merge remote-tracking branch
'origin/GP-2257_ghidorahrex_PR-4378_Nalen98_eBPF-proc-support'
(Closes #4378)
2023-05-01 06:30:25 -04:00
Ryan Kurtz
6984c87da8 Merge remote-tracking branch
'origin/GP-2257_ghidorahrex_PR-4258_Heurs_bpf_processor' (Closes #4258)
2023-05-01 06:28:22 -04:00
Ryan Kurtz
5b6a902c8c Merge remote-tracking branch 'origin/GP-3077_emteere_CrossedConstants--SQUASHED' 2023-05-01 06:25:01 -04:00
dev747368
87c16f9cd0 GP-2114 golang import / analyzer 2023-05-01 02:02:53 -04:00
emteere
02248d2251 GP-3077 Added constant tracking through stack for stack parameters, fixed issues with values getting crossed moving in and out of memory, added prototype param type creation, added setting for restricting parameters to know pointers to handle harvard architectures and pointertypedefs 2023-05-01 01:57:56 -04:00
emteere
e0e9c0d137 GP-2257 minor refactoring to collapse constructors, added sleigh lint
flag, removed killed by call causing CONCATs
2023-04-29 21:56:45 +00:00
ghidra1
b9202411b9 GP-1379/3022 FloatFormat and BigFloat refactor in support of string
parsing and 80-bit float format.  Change float datatype naming to use
number of bits instead of bytes.
2023-04-26 16:55:48 -04:00
ghidra1
f7f03c0ca2 Merge remote-tracking branch 'origin/GP-3258_x86_changes_for_fid' 2023-04-26 12:11:47 -04:00
ghidra1
bc52cf8a29 Merge branch 'GP-2487_ghidracadabra_PR-4336_ekilmer_fix-lock-prefix'
(Closes #4336)
2023-04-26 12:11:10 -04:00
James
56c395b39d GP-2487 formatting and misc improvements, fixing MOV duplicate patterns 2023-04-26 12:05:55 -04:00
Ryan Kurtz
3db2aff597 Merge remote-tracking branch
'origin/GP-2880_ghidorahrex_m68k_bcd_operand_fix--SQUASHED'
(Closes #4183, Closes #4189)
2023-04-25 06:44:51 -04:00
Ryan Kurtz
83dd38ca7d Merge remote-tracking branch
'origin/GP-3169_ghidorahrex_PR-5067_GaryOderNichts_fix_hcs12_tsta_carry'
(Closes #5067)
2023-04-25 06:27:50 -04:00
ghidorahrex
dd84e1a6e6 GP-2880: Fix issue with 68000 bcd instructions reversing operands 2023-04-24 13:11:05 -04:00
ghidorahrex
57d645dc92 GP-3341: Fixed PowerPC LR register for conditional BLR* 2023-04-21 19:39:33 +00:00