2023-12-18 2023-12-18 安装msys2 1 pacman -S nasm 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; ---------------------------------------------------------------------------------------- ; 仅使用系统调用来输出 "Hello, World" 到控制台。 这个程序仅windows 64 下运行。 ; 如何编译执行: ; ; nasm -fwin64 hello.s && gcc hello.obj && ./a.exe ; ---------------------------------------------------------------------------------------- global main extern puts section .text main: sub rsp, 20h mov rcx, message call puts add rsp, 20h message: db "Hello, World", 0 windows下汇编比较复杂,但是为了方便学习,使用nasm进行编译,操作,为了适应intel语法,使用gcc链接,为了能够使用puts这样的函数,比winapi(WriteConsoleA)要简单很多。 前一篇 解决cloudflare worker遇到failed to dial to (wss://): 200 OK > websocket: bad handshake 的问题 后一篇 使用dism++重置无法启动的Windows
说些什么吧!