flat assembler
Message board for the users of flat assembler.
Index
> Main > distance between variables. In code, not memory. |
Author |
|
ouadji 27 Feb 2011, 09:33
|
|||
27 Feb 2011, 09:33 |
|
b1528932 27 Feb 2011, 16:45
but seriously, i want to pad my file. Should i use external program to do that or what.
|
|||
27 Feb 2011, 16:45 |
|
edfed 27 Feb 2011, 19:22
no way, to know the distance between two labels... just think a little, labels are just values, then, the distance between two values... you can't find?
of course, ones you declare a new adress space with org directive, all labels before are relative to previous adress space. then, if you do that: Code: org 100h label1: rd 342354 org 100h label2: rd 5435 org 100h label 3: rd 3435 all three labels will have the same value, then, cannot extract any absolute distance between. because separate adress spaces means: not at the same place, and can't predict effective distance ones in memory... because can be loaderd in distincts zones... |
|||
27 Feb 2011, 19:22 |
|
b1528932 27 Feb 2011, 20:10
ok, so any idea how can i pad to the end of a sector without worrying about org positions?
|
|||
27 Feb 2011, 20:10 |
|
edfed 27 Feb 2011, 21:38
easy, did you read some code from this board before to ask?
i think you should search in OS construction section. i posted many of them and the technique is easy. from FASM manual, $ refer to the current offset... and $$ refer to the origin of the current adress space. then, to padd a sector, just org it with any value you want (7C00h is better) and then, do the simple: free=510-($-$$) padding rb free did i answer your question? and better, did it help you to understand |
|||
27 Feb 2011, 21:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.