Author Topic: [SOLVED] "times" macro advanced use  (Read 10648 times)

Offline Crysein

  • Jr. Member
  • *
  • Posts: 5
[SOLVED] "times" macro advanced use
« on: August 21, 2021, 03:53:36 PM »
Hello,

Is there a similar way to do such thing ?

Code: [Select]
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
Code: [Select]
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
Code: [Select]
times 512 times 512 dq 0
« Last Edit: August 22, 2021, 10:21:13 AM by Crysein »

Offline debs3759

  • Global Moderator
  • Full Member
  • *****
  • Posts: 224
  • Country: gb
    • GPUZoo
Re: "times" macro advanced use
« Reply #1 on: August 21, 2021, 09:18:20 PM »
Other than

times 512 * 512 dq 0

The only alternative I can see would be to do something like:

Code: [Select]
%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.
My graphics card database: www.gpuzoo.com