From f3e04aa7d49b275cdce51411bfe3a8b1c8d3f446 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 14 Dec 2019 16:16:48 -0500 Subject: [PATCH] add PFX command. --- link.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/link.cpp b/link.cpp index c827fba..3eed87e 100644 --- a/link.cpp +++ b/link.cpp @@ -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);