Author Topic: 2 simple questions  (Read 16570 times)

sancho1980

  • Guest
2 simple questions
« 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

nobody

  • Guest
Re: 2 simple questions
« Reply #1 on: July 21, 2007, 04:18:15 AM »
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