NASM Forum > Programming with NASM
[SOLVED] "times" macro advanced use
(1/1)
Crysein:
Hello,
Is there a similar way to do such thing ?
--- Code: ---Paging1GBTable:
;{
.PML4: times 512 dq 0 ; Page Map Level 4, each address is pointing to a single PDPT
.PDPTList:
;{
times 512 ; 512 PDP Tables
(
times 512 dq 0 ; 512 address pointing to a 1 Gbyte physical page
)
;}
;}
EndPaging1GBTable:
--- End code ---
I know that I could just do
--- Code: ---times 512 * 512 dq 0
--- End code ---
But I prefer the first code style for the sake to be more human language friendly.
Btw doing the below code do nothing, it's like writing times 512 dq 0
--- Code: ---times 512 times 512 dq 0
--- End code ---
debs3759:
Other than
times 512 * 512 dq 0
The only alternative I can see would be to do something like:
--- Code: ---%rep 512
time 512 dq 0
%endrep
--- End code ---
but I think that would take longer to assemble. I haven't tested it to confirm that %rep and times work together.
Navigation
[0] Message Index
Go to full version