mirror of
https://github.com/cc65/cc65.git
synced 2024-09-27 19:55:09 +00:00
Output MX states
This commit is contained in:
parent
4b04f81d37
commit
65907b1f10
@ -64,6 +64,8 @@
|
|||||||
#include "segment.h"
|
#include "segment.h"
|
||||||
|
|
||||||
|
|
||||||
|
static unsigned PrevAddrMode;
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Code */
|
/* Code */
|
||||||
@ -442,6 +444,22 @@ static void OneOpcode (unsigned RemainingBytes)
|
|||||||
** following insn, fall through to byte mode.
|
** following insn, fall through to byte mode.
|
||||||
*/
|
*/
|
||||||
if (D->Size <= RemainingBytes) {
|
if (D->Size <= RemainingBytes) {
|
||||||
|
if (CPU == CPU_65816) {
|
||||||
|
const unsigned AddrMode = GetAttr (PC) & at65816Mask;
|
||||||
|
if (PrevAddrMode != AddrMode) {
|
||||||
|
if ((PrevAddrMode & atMem8) != (AddrMode & atMem8) ||
|
||||||
|
(PrevAddrMode & atMem16) != (AddrMode & atMem16)) {
|
||||||
|
OutputMFlag(!!(AddrMode & atMem8));
|
||||||
|
}
|
||||||
|
if ((PrevAddrMode & atIdx8) != (AddrMode & atIdx8) ||
|
||||||
|
(PrevAddrMode & atIdx16) != (AddrMode & atIdx16)) {
|
||||||
|
OutputXFlag(!!(AddrMode & atIdx8));
|
||||||
|
}
|
||||||
|
|
||||||
|
PrevAddrMode = AddrMode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Output labels within the next insn */
|
/* Output labels within the next insn */
|
||||||
for (I = 1; I < D->Size; ++I) {
|
for (I = 1; I < D->Size; ++I) {
|
||||||
ForwardLabel (I);
|
ForwardLabel (I);
|
||||||
@ -517,6 +535,8 @@ static void OnePass (void)
|
|||||||
{
|
{
|
||||||
unsigned Count;
|
unsigned Count;
|
||||||
|
|
||||||
|
PrevAddrMode = 0;
|
||||||
|
|
||||||
/* Disassemble until nothing left */
|
/* Disassemble until nothing left */
|
||||||
while ((Count = GetRemainingBytes()) > 0) {
|
while ((Count = GetRemainingBytes()) > 0) {
|
||||||
OneOpcode (Count);
|
OneOpcode (Count);
|
||||||
|
@ -401,3 +401,23 @@ void OutputSettings (void)
|
|||||||
LineFeed ();
|
LineFeed ();
|
||||||
LineFeed ();
|
LineFeed ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void OutputMFlag (unsigned char enabled)
|
||||||
|
/* Output the 65816 M-flag state */
|
||||||
|
{
|
||||||
|
Indent (MCol);
|
||||||
|
Output (enabled ? ".a8" : ".a16");
|
||||||
|
LineFeed ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void OutputXFlag (unsigned char enabled)
|
||||||
|
/* Output the 65816 X-flag state */
|
||||||
|
{
|
||||||
|
Indent (MCol);
|
||||||
|
Output (enabled ? ".i8" : ".i16");
|
||||||
|
LineFeed ();
|
||||||
|
}
|
||||||
|
@ -108,6 +108,12 @@ void LineComment (unsigned PC, unsigned Count);
|
|||||||
void OutputSettings (void);
|
void OutputSettings (void);
|
||||||
/* Output CPU and other settings */
|
/* Output CPU and other settings */
|
||||||
|
|
||||||
|
void OutputMFlag (unsigned char enabled);
|
||||||
|
/* Output the 65816 M-flag state */
|
||||||
|
|
||||||
|
void OutputXFlag (unsigned char enabled);
|
||||||
|
/* Output the 65816 X-flag state */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* End of output.h */
|
/* End of output.h */
|
||||||
|
Loading…
Reference in New Issue
Block a user