EXT support. 8/16+ added EXT as an operand to import an absolute linker value into the local symbol table.

This commit is contained in:
Kelvin Sherlock 2019-12-15 13:05:41 -05:00
parent 637df6ee33
commit 57525d5464
2 changed files with 16 additions and 0 deletions

View File

@ -932,6 +932,18 @@ void evaluate(label_t label, opcode_t opcode, const char *cursor) {
define(label, number_operand(cursor, local_symbol_table), LBL_GEQ);
break;
case OP_EXT: {
/* no label is a no-op. */
if (label.empty()) break;
/* otherwise, it imports an absolute label into the local symbol table */
auto e = find_symbol(label, false);
if (!e || !e->absolute) throw std::runtime_error("Bad address");
define(label, e->value, LBL_EXT);
break;
}
case OP_SEG: {
/* OMF object file linker - set the object file seg name */
std::string name = label_operand(cursor);

4
link.h
View File

@ -36,6 +36,8 @@ c = command file
POS n y n
LEN n y n
EXT n n y << imports from linker to command
*/
enum {
LBL_EQU = (1 << 0),
@ -45,6 +47,8 @@ enum {
LBL_EQ = (1 << 2),
LBL_POS = (1 << 1),
LBL_LEN = (1 << 1),
LBL_EXT = (1 << 2)
};
void process_script(const char *argv);