Commit graph

18 commits

Author SHA1 Message Date
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
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
Ryan Kurtz 0ed00bdd50 GP-0: Fixing the remainder of the "psuedo" spellings (#4601) 2022-09-20 01:02:00 -04:00
ghidra1 162f203395 Updated certification headers 2021-03-17 18:22:50 -04:00
mumbel dce6e9f6a8 Cleaning up warnings and errors, mostly looking for:
temporary is written but not read in constructor
2020-01-22 19:51:45 -06:00
emteere 3d9525985b GT-3058: Constrained matching so that order of instruction definitions
don't matter.

Pulled-from: Marcus Comstedt <marcus@mc.pp.se>
2019-08-02 15:19:40 -04:00
Marcus Comstedt 62d5fa3b9d 8048: Remove the localrange declaration for the stack 2019-07-19 19:38:58 +02:00
Marcus Comstedt 3a8e59319a 8048: Reformat to begin and end each semantic section with NL (unless empty) 2019-07-19 19:38:57 +02:00
Marcus Comstedt 4f6e4bc172 8048: Avoid @ifdef inside a semantic section 2019-07-19 19:38:57 +02:00
Marcus Comstedt 9a1f5e60bf 8048: Avoid use of unquoted # in the display section 2019-07-19 19:38:57 +02:00
Marcus Comstedt 4531aa402f 8048: Avoid use of @define without value 2019-07-19 19:38:56 +02:00
Marcus Comstedt 3dfb8bc974 8048: Avoid use of macro expansion 2019-07-19 19:38:56 +02:00
Marcus Comstedt 45cfc3cfc2 Add processor implementation for 8048 (MCS-48) 2019-05-30 19:34:44 +02:00