You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* findlabel() determines the memory address that follows the opcode. If the memory address is already a number, it adds the base address to this and returns the result */
739
+
/* findlabel() determines the memory address that follows the opcode. If the memory address is already a number, and returns it */
740
740
/* If it is an undeclared label, it adds the label name and the instruction location to the "unknown labels" collection. If the label is declared, it returns it's address */
741
-
unsigned short intfindlabel(label**unknownlabels, label**labels, constchar*labelstr, unsigned short intbaseaddr, unsigned long longnumlabels, unsigned long long*numunknownlabels, unsigned long longbits)
741
+
unsigned short intfindlabel(label**unknownlabels, label**labels, constchar*labelstr, unsigned long longnumlabels, unsigned long long*numunknownlabels, unsigned long longbits)
742
742
{
743
743
/* endptr is used to check if the strtol finds a valid number. */
744
744
/* If not, it's likely a label. */
@@ -844,8 +844,8 @@ unsigned short int findlabel(label **unknownlabels, label **labels, const char *
844
844
/* If there is no error from strtol, the token after the assembly instruction is probably a numerical value. */
845
845
else
846
846
{
847
-
/* So add the base address to it, and return it as is. */
848
-
address=(tempaddress+baseaddr);
847
+
/* Assume the programmer knows what he's doing and directly assign it. */
Copy file name to clipboardExpand all lines: src/as4.h
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -52,9 +52,9 @@ void adddata(char **outbuf, size_t bufsize, unsigned long long size, long long v
52
52
/* addlabel() adds a label to the collection of labels, to be used by other functions when a label reference is made. */
53
53
/* Additionally, if there are outstanding "queries" for a certain label (if the label has been used before it has been declared) it replaces the "unknown address" address in an instruction with the address of the label on declaration */
54
54
voidaddlabel(char*outbuf, label**labels, label**unknownlabels, unsigned long long*numlabels, unsigned long longnumunknownlabels, constchar*labelstr, unsigned long longbits, unsigned short intbaseaddr);
55
-
/* findlabel() determines the memory address that follows the opcode. If the memory address is already a number, it adds the base address to this and returns the result */
55
+
/* findlabel() determines the memory address that follows the opcode. If the memory address is already a number, returns it */
56
56
/* If it is an undeclared label, it adds the label name and the instruction location to the "unknown labels" collection. If the label is declared, it returns it's address */
57
-
unsigned short intfindlabel(label**unknownlabels, label**labels, constchar*labelstr, unsigned short intbaseaddr, unsigned long longnumlabels, unsigned long long*numunknownlabels, unsigned long longbits);
57
+
unsigned short intfindlabel(label**unknownlabels, label**labels, constchar*labelstr, unsigned long longnumlabels, unsigned long long*numunknownlabels, unsigned long longbits);
58
58
/* addstring() handles adding .ascii and .ascii (zero terminating ascii string) to the output buffer, including handling escape characters. */
59
59
voidaddstring(char*outbuf, char*string, charzeroterm, unsigned long long*bits, unsigned long long*bytes);
0 commit comments