Okay... second question! i've seen code using NASM for shoving in a variable bunch of bytes into a program based on current position (e.g. for patching or use in a boot sector) like this:



db SizeAtPosition - ($-$$) dup (?)



This doesn't work in MASM and i tried several work arounds. no matter what i tried, i usually got some error about using a constant instead of a variable.

Thanks in advance :)
Posted on 2002-07-24 20:49:40 by jademtech
Desired_Size equ 512


Start_of_BootSector:
...
...
...
End_of_BootSector:
db Desired_Size - ( $ - Start_of_BootSector) dup ("*")
MASM doesn't support $$. IIRC, it is the start of the segment - should look in the MASM manual to find out how to reference the start of the segment. ;)
Posted on 2002-07-24 21:10:16 by bitRAKE
Possibly a label?

e.g.



Desired_Size equ 512

PositionStart LABEL
Start_of_BootSector:
...
...
...
End_of_BootSector:
db Desired_Size - ( $ - PositionStart) dup ("*")


anyway, i'll test this out (when i get a chance) and see what happens... thanks :)
Posted on 2002-07-25 08:47:44 by jademtech