daily update on 20230316 by nitload youmu

This commit is contained in:
Nitload
2023-03-17 01:52:35 +08:00
parent 2b3c6cea88
commit 167e33a3dd
95 changed files with 191669 additions and 85 deletions
+15
View File
@@ -0,0 +1,15 @@
.386 ; 编译器指令,使用386指令集
.model flat, stdcall ; model汇编指令,程序的内存模式, flat是windows程序,没有远近指针,stdcall是windows函数用的参数方式,即参数从右向左传递
option casemap :none ; 标签是否区分大小写
include \masm32\include\windows.inc ; 包含了Win32 API 的一些常量和函数定义
include \masm32\include\kernel32.inc ; 包含了后面使用的ExitProcess函数
include \masm32\include\masm32.inc ; 包含了后面使用的StdOut函数,不是标准的Win32函数,由MASM提供
includelib \masm32\lib\kernel32.lib ; 库文件
includelib \masm32\lib\masm32.lib
.data
HelloWorld db "Hello World!", 0 ; 定义使用的字符串常量,db代表define byte。最后跟一个NUL,表示ANSI字符集结束符
.code ; 开始代码区
start: ; 所有的代码要在start标签后、end start前
invoke StdOut, addr HelloWorld ; 调用函数StdOut,参数量HelloWorld的地址。注意StdOut是MASM提供的宏。其它编辑器里可以使用WriteConsole之类win32函数代替。
invoke ExitProcess, 0 ; 调用ExitProcess
end start