Instruction pairing extended to more than two instructions.

This commit is contained in:
Adrian Matoga 2021-03-14 23:32:32 +01:00
parent 8f06fec50c
commit cca8c374f9
1 changed files with 10 additions and 5 deletions

View File

@ -2659,19 +2659,24 @@ unittest {
void assemblyPair() {
assert(!inOpcode);
string instruction = readInstruction();
if (!eol() && line[column] == ':') {
string[] extraInstructions;
while (!eol() && line[column] == ':') {
pairing = true;
column++;
string instruction2 = readInstruction();
extraInstructions ~= readInstruction();
}
if (!extraInstructions.empty) {
int savedColumn = column;
if (willSkip)
warning("Skipping only the first instruction");
assemblyInstruction(instruction);
checkNoExtraCharacters();
column = savedColumn;
wereManyInstructions = false;
assemblyInstruction(instruction2);
wereManyInstructions = true;
foreach (instruction2; extraInstructions) {
column = savedColumn;
assemblyInstruction(instruction2);
wereManyInstructions = true;
}
} else {
pairing = false;
assemblyInstruction(instruction);