.SH section
\.section <name>
- Defines a section name.
+ Defines a section name.
+ For mlb files .section will use the address (set via .org) present at the time of
+ invoking .section as an offset address.
.SH SEE ALSO
ulas.chksm = 0;
ulas.filename = ulas.initial_filename;
ulas.section[0] = '\0'; // reset section
+ ulas.section_address = 0;
for (int i = 0; i < ULAS_CHARCODEMAPLEN; i++) {
ulas.charcodemap[i] = (char)i;
}
int ulas_symbolout_mlbloc(FILE *dst, long addr) {
+ if (ulas.section[0] != '\0') {
+ fprintf(dst, "%s:", ulas.section);
+ return (int)ulas.section_address;
+ }
+
if (addr == -1) {
fprintf(dst, "Unknown:");
return 0;
return -1;
}
strncpy(ulas.section, ulas.tok.buf, ULAS_SECTIONMAX);
+ ulas.section_address = ulas.address;
return 0;
}
// but cna be set with a directive
char charcodemap[ULAS_CHARCODEMAPLEN];
char section[ULAS_SECTIONMAX];
-
+ // where was the section defined?
+ unsigned int section_address;
+
struct ulas_arch arch;
};