Skip to content

Commit 6589041

Browse files
committed
Add yasm test.
1 parent 285e7f6 commit 6589041

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

test/build/yasm/common.asm

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
global main
2+
extern ExitProcess ; external functions in system libraries
3+
extern MessageBoxA
4+
5+
section .data
6+
title: db 'Win64', 0
7+
msg: db 'Hello world!', 0
8+
9+
section .text
10+
main:
11+
sub rsp, 28h
12+
mov rcx, 0 ; hWnd = HWND_DESKTOP
13+
lea rdx,[msg] ; LPCSTR lpText
14+
lea r8,[title] ; LPCSTR lpCaption
15+
mov r9d, 0 ; uType = MB_OK
16+
call MessageBoxA
17+
add rsp, 28h
18+
19+
mov ecx,eax
20+
call ExitProcess
21+
22+
hlt ; never here
23+

test/build/yasm/host.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"native": {
3+
"stdlib": {
4+
"kernel": "com.Microsoft.Windows.SDK.um-8"
5+
}
6+
}
7+
}

test/build/yasm/sw.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
void build(Solution &s)
2+
{
3+
auto &t = s.addExecutable("x");
4+
{
5+
t.setExtensionProgram(".asm", "org.sw.demo.yasm"_dep);
6+
t += "common.asm";
7+
t += "user32.lib"_slib;
8+
t.LinkOptions.push_back("/LARGEADDRESSAWARE:NO");
9+
}
10+
}

0 commit comments

Comments
 (0)