What do you think about adding assembler-level
pseudo-instruction '=', which will assign critical
expression value to a label? This would be useful if we
adding support for IDEAL model.
.model tiny
.code
a1 equ 2 ; constant
a2 = 1 ; ca be re-defined later
l:
end
...and look at the resulting .lst file, and you'll see
that both interpret "a1" and "a2" as numbers (no segment
portion), but "l" as a label (with segment portion). If
you need further proof, just try e.g. a JMP: while "l"
can be used as a target, neither "a1" nor "a2" can be.
So if we were to add "label[:] = <critical expression>"
support, then it wouldn't be the same as in MASM or TASM.
Another thing to keep in mind is that labels without a
trailing colon pose one of the syntactical warts allowed
by NASM, for historical reasons. In fact, it is this very
wart that has prevented a large number of NASM users I've
met over the past few years from grasping the difference
between a scalar and a label. (My forked version is quite
strict about the two; it even offers the OFF operator.)
Last but not least, I'm not a big fan of weakening NASM's
clean and strict syntax just so that it can feed on TASM
code. IMO the proper approach is to come up with a "third
party" conversion program or script instead.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=804543
Feed the following code to MASM or TASM...
.model tiny
.code
a1 equ 2 ; constant
a2 = 1 ; ca be re-defined later
l:
end
...and look at the resulting .lst file, and you'll see
that both interpret "a1" and "a2" as numbers (no segment
portion), but "l" as a label (with segment portion). If
you need further proof, just try e.g. a JMP: while "l"
can be used as a target, neither "a1" nor "a2" can be.
So if we were to add "label[:] = <critical expression>"
support, then it wouldn't be the same as in MASM or TASM.
Another thing to keep in mind is that labels without a
trailing colon pose one of the syntactical warts allowed
by NASM, for historical reasons. In fact, it is this very
wart that has prevented a large number of NASM users I've
met over the past few years from grasping the difference
between a scalar and a label. (My forked version is quite
strict about the two; it even offers the OFF operator.)
Last but not least, I'm not a big fan of weakening NASM's
clean and strict syntax just so that it can feed on TASM
code. IMO the proper approach is to come up with a "third
party" conversion program or script instead.