NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: sancho1980 on July 20, 2007, 09:20:14 AM
-
hi
1) can someone please tell me how, in a nasm source file, i can specify a constant expression with the remainder, example
"db 7/4" is equivalent "db 2"
what i want is the remainder:
"db 7%4" doesnt seem to work, how do i express that??
2) i want to write a makefile, which demands that some constant expression in two.asm depends on the size of one.bin (nasm -f bin -o one.bin one.asm):
-how do i find out the size of one.bin after its compilation?
-how do i set the environment variable in the makefile?
-how can i access it in the source of two.asm??
thanks in advance
martin
-
1) I think "db 7 % 4" will do it, as long as you've got whitespace around the '%'.
2) I don't know much about makefiles. You can find the size of "one.bin" in "two.???" at runtime - sys_readdir or FindFirst or whatever. In order to provide the size of "one.bin" to "two.asm"... I think you're just going to have to type it in. Or I guess you could do it on the command line - "-dONE_SIZE=1234". You could:
aaa:
incbin "one.bin"
zzz:
one_size equ zzz - aaa
but I don't suppose that's what you want to do. (or maybe it is...)
Best,
Frank