NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: Crysein on August 21, 2021, 03:53:36 PM
-
Hello,
Is there a similar way to do such thing ?
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:
I know that I could just do
times 512 * 512 dq 0
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
times 512 times 512 dq 0
-
Other than
times 512 * 512 dq 0
The only alternative I can see would be to do something like:
%rep 512
time 512 dq 0
%endrep
but I think that would take longer to assemble. I haven't tested it to confirm that %rep and times work together.