1
0
Fork 0

Update MASM notation and refactor code.

This commit is contained in:
kalhotky 2025-07-11 20:12:17 +02:00
parent 195e6ab3f3
commit 56195a3a66
2 changed files with 22 additions and 36 deletions

View File

@ -455,10 +455,13 @@ QString ZydisTokenizer::printValue(const TokenValue & value, bool expandModule)
switch(mValueNotation)
{
case DisasmValueNotationC:
finalText = QString("0x") + addrText;
finalText = "0x" + addrText;
break;
case DisasmValueNotationMASM:
finalText = QString("0") + addrText + QString("h");
if((addrText[0] >= 'A' && addrText[0] <= 'F') || (addrText[0] >= 'a' && addrText[0] <= 'f'))
finalText = "0" + addrText + "h";
else
finalText = addrText + "h";
break;
default:
finalText = addrText;

View File

@ -228,47 +228,30 @@ void LocalVarsView::updateSlot()
QString expr;
QString name;
if(j < 0)
{
expr = QString("%1").arg(-j, 0, 16);
switch(ValueNotation)
{
case DisasmValueNotationC:
expr = "0x" + expr;
break;
case DisasmValueNotationMASM:
expr = "0" + expr + "h";
break;
default:
break;
}
if(!MemorySpaces)
expr = "-" + expr;
else
expr = " - " + expr;
}
else
{
expr = QString("%1").arg(j, 0, 16);
switch(ValueNotation)
{
case DisasmValueNotationC:
expr = "0x" + expr;
break;
case DisasmValueNotationMASM:
switch(ValueNotation)
{
case DisasmValueNotationC:
expr = "0x" + expr;
break;
case DisasmValueNotationMASM:
if((expr[0] >= 'A' && expr[0] <= 'F') || (expr[0] >= 'a' && expr[0] <= 'f'))
expr = "0" + expr + "h";
break;
default:
break;
}
if(!MemorySpaces)
expr = "+" + expr;
else
expr = " + " + expr;
expr = expr + "h";
break;
default:
break;
}
if(!MemorySpaces)
expr = ((j < 0) ? "-" : "+") + expr;
else
expr = ((j < 0) ? " - " : " + ") + expr;
expr = QString("[%1%2]").arg(baseRegisters[i]->text()).arg(expr);
if(i == 4) //CBP
{