Commit Graph

15 Commits

Author SHA1 Message Date
James
697718ff35 GP-4401 code review changes 2024-03-25 14:04:37 +00:00
James
000085a82f add/subtract with carry tweaks 2024-03-18 21:53:05 +00:00
James
68270ac6d9 minor tweaks 2024-03-18 17:14:15 +00:00
flk0
3c11e8f59f Correct errors in the MSP430 SLEIGH specification
This patch modifies the SLEIGH specification of MSP430 (but not the MSP430X extension) to produce pcode that more accurately reflects the actual behaviour of the instruction set. These changes were derived by testing the Ghidra emulation of MSP430 instructions against the behaviour of an MSP430FR5994 dev board.

The changes include:
    Unaligned (odd) word memory accesses and writes now properly round down rather than accessing unaligned memory. This affects instructions that depend on the stack pointer, which can be misaligned.

    The PC register can now never become misaligned (it's low bit is effectively zero).

    Accesses of the PC register now properly reflect the address of the next instruction.

    Instructions that use the status register (SR) as a general source register have been modified to prevent changes to the status codes (embedded in SR) to clobber the value of SR prior to its use in the operation. There is more work to be done to correct the behaviour of instructions where SR is used as the destination register.

    Instructions of the form MNEM @reg+ X(reg) where the source and dest use the same register now accurately reflect the source increment in the calculation of the dest value. [These instruction behaves as: fetch source, increment source, fetch dest]

    The implementation of the V flag for ADDC, SUBC, and related emulated instructions now reflects comparing the src and dest signs (without the carry) with the result sign (which includes the carry). [The original implementation adds the carry to either the source or dest prior to scarry]

    Added an implementation of the decimal add instructions that may be clunky, but accurately performs the operations.

    The RRC instruction now clears the V flag.

    A new table has been added for single operand instructions, as tbl_bzero was incorrectly applied (single operand instructions use the as (not ad) token for the dest).

    The carry flag was inverted for DEC and DECD.

    Corrections for corner case instructions: PUSH/POP SP, PUSH/CALL X(SP), BR @reg+.
2024-03-15 20:00:10 +00:00
ghidra1
3ead54f0ac GP-4239 Transitioned to new AbstractElfRelocationHandler implementation which uses ElfRelocationType enums specific to each handler. 2024-02-12 10:52:25 -05:00
James
e7f5a8a5a1 GP-4152 msp430 ELF relocation fixes 2024-01-17 19:09:10 -05:00
ghidra1
325c48e904 GP-4152 added ability for ELF extension to specify default image base 2024-01-17 19:08:21 -05:00
James
1e82a772c5 GP-4152 msp430 improvements 2024-01-17 19:08:03 -05:00
James
d39a5e8365 GP-4149 frame descriptor entry fix and msp430 improvements 2023-12-14 20:22:16 +00:00
ghidorahrex
6581ff6230 GP-2112: Fix issue with MSP430 RPT using correct operands 2022-06-07 18:21:20 +00:00
ghidra1
162f203395 Updated certification headers 2021-03-17 18:22:50 -04:00
ghidorahrex
02319781b6 GT-3466 Fixed export of local variables as constants 2020-02-07 12:07:26 -05:00
ghidravore
f1e50fb079 Major refactoring of the gradle build system. 2019-04-23 15:20:26 -04:00
ghidra1
7179c6de81 GT-2667 added support for generating sleigh build.xml files 2019-03-29 17:24:31 -04:00
Dan
79d8f164f8 Candidate release of source code. 2019-03-26 13:46:51 -04:00