Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include-hax/fake_masm/macamd64.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
push_reg macro Reg
push Reg
.pushreg Reg
endm

alloc_stack macro Size
sub rsp, Size
.allocstack Size
endm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.

include ksamd64.inc

@illwieckz illwieckz Jun 25, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may mention this in the commit message, but it works because all that is needed is two macros from macamd64.inc, and ksamd64.inc included macamd64.inc so it was overkill to include ksamd64.inc but it worked.

When stubbing it we better make it as short as possible.

On MSVC, the standard macamd64.inc will be used, on MinGW the stub will be used by adding the directory containing it to the list of include directories.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if I remember correctly the standard .inc files use some formatting variants (especially in comment formatting or other useless things like that) that are incompatible with JWasm. The stub is kept as minimal as possible and use a formatting meant to please JWasm. By luck the NaCl .asm file is already compatible with both MASM and JWasm.

include macamd64.inc

EXTERN NaClSwitch : QWORD

Expand Down