add PFX command.

This commit is contained in:
Kelvin Sherlock 2019-12-14 16:16:48 -05:00
parent b6e397b959
commit f3e04aa7d4

View File

@ -604,6 +604,16 @@ static std::string basename(const std::string &str) {
return str.substr(0, ix);
}
/* fixup GS/OS strings. */
static void fix_path(std::string &s) {
for (char &c : s)
if (c == ':') c = '/';
}
/*
SEG name -> undocumented? command to set the OMF segment name (linker 3 only)
*/
void evaluate(label_t label, opcode_t opcode, const char *cursor) {
// todo - should move operand parsing to here.
@ -674,6 +684,17 @@ void evaluate(label_t label, opcode_t opcode, const char *cursor) {
break;
}
case OP_PFX: {
std::string path = path_operand(cursor);
fix_path(path);
int ok = chdir(path.c_str());
if (ok < 0)
warn("PFX %s", path.c_str());
break;
}
case OP_TYP:
ftype = number_operand(cursor, file_types, OP_REQUIRED | OP_INSENSITIVE);