NASM - The Netwide Assembler
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Calendar
Login
Register
NASM - The Netwide Assembler
»
NASM Forum
»
Using NASM
»
times 512 -($-$$) db 0
« previous
next »
Print
Pages: [
1
]
Author
Topic: times 512 -($-$$) db 0 (Read 13753 times)
bitbit
New Member
Posts: 1
times 512 -($-$$) db 0
«
on:
March 06, 2011, 02:24:10 PM »
Code:
[Select]
times 512 -($-$$) db 0
What does $ and $$ stand for?
What says the argument 512 -($-$$) of times in this context?
bitbit
Logged
Frank Kotler
NASM Developer
Hero Member
Posts: 2667
Country:
Re: times 512 -($-$$) db 0
«
Reply #1 on:
March 06, 2011, 03:26:50 PM »
'$' is roughly "here" (in this context). '$$' is "beginning of section". So "$-$$" is an expression that calculates the length of your code, so far. So your code gets padded out to 512 bytes.
Best,
Frank
Logged
Keith Kanios
Full Member
Posts: 383
Country:
Re: times 512 -($-$$) db 0
«
Reply #2 on:
March 06, 2011, 09:18:09 PM »
It's all explained in the
NASM Documentation
.
Logged
Print
Pages: [
1
]
« previous
next »
NASM - The Netwide Assembler
»
NASM Forum
»
Using NASM
»
times 512 -($-$$) db 0