diff --git a/asm.cpp b/asm.cpp index a0292d4..078ec69 100644 --- a/asm.cpp +++ b/asm.cpp @@ -1357,7 +1357,6 @@ void CLASS::initpass(void) s = Poco::trim(Poco::toUpper(s)); cpumode = MODE_65816; - mx = 0x00; if (s == "M65816") { @@ -1377,7 +1376,10 @@ void CLASS::initpass(void) else { printf("Unknown CPU type in .ini\n"); + mx=0x00; } + mx = getInt("asm.startmx",mx);; + relocatable = false; currentsym = NULL; currentsymstr=""; diff --git a/opcodes.cpp b/opcodes.cpp index 38bddf5..1140438 100644 --- a/opcodes.cpp +++ b/opcodes.cpp @@ -576,6 +576,10 @@ int CLASS::doBase6502(MerlinLine & line, TSymbol & sym) bytelen++; } } + if ( ((m==syn_absx) || (m==syn_diix)) && ((sym.opcode==4) || (sym.opcode==5))) // these are STX,LDX + { + err=true; + } if ((m == syn_absx) || (m == syn_abs) || (m == syn_absy)) { if ((line.flags & FLAG_FORCEABS) || (line.expr_value >= 0x100)) @@ -829,7 +833,7 @@ void CLASS::insertOpcodes(void) pushopcode("BNE", 0x03, 0, OPHANDLER(&CLASS::doBRANCH)); pushopcode("BPL", 0x00, 0, OPHANDLER(&CLASS::doBRANCH)); pushopcode("BRA", 0x40, 0, OPHANDLER(&CLASS::doBRANCH)); - pushopcode("BRK", 0x00, 0, OPHANDLER(&CLASS::doBYTE)); + pushopcode("BRK", 0x00, 1, OPHANDLER(&CLASS::doAddress)); pushopcode("BRL", 0x20, 0, OPHANDLER(&CLASS::doBRANCH)); pushopcode("BVC", 0x01, 0, OPHANDLER(&CLASS::doBRANCH)); pushopcode("BVS", 0x81, 0, OPHANDLER(&CLASS::doBRANCH)); diff --git a/qasm.ini b/qasm.ini index a0e4d4a..78c0ba2 100644 --- a/qasm.ini +++ b/qasm.ini @@ -21,7 +21,8 @@ path5=dirpath5 [asm] casesen=true -showmx=false +showmx=true +startmx=3 lst=true ; can be M6502, M65C02, M65816 cpu=M65816