Skip to content

Commit cebb8c4

Browse files
authored
Merge pull request #2 from b1tg/b1tg-patch-1
Fix string inline error
2 parents 2c06bf0 + 56678b4 commit cebb8c4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

masm_shc/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,12 @@ bool process_file(t_params &params)
196196
ofile << consts_lines[curr_const] << "\n";
197197
ofile << label_after << ":\n";
198198
if (tokens.size() > 2 && (tokens[0] == "lea" || tokens[0] == "mov")) {
199-
std::string reg = tokens[1];
200-
ofile << "\tPOP " << reg << "\n";
199+
auto offset_index = find(tokens.begin() + 1, tokens.end(), "OFFSET");
200+
std::string instructions = tokens[1];
201+
if(std::distance(tokens.begin(), offset_index) == 4) {
202+
instructions = tokens[1] + " " + tokens[2]+ " " + tokens[3];
203+
}
204+
ofile << "\tPOP " << instructions << "\n";
201205
}
202206
ofile << "\n";
203207
ofile << "; " << line << "\n"; //copy commented out line

0 commit comments

Comments
 (0)