# Asm **Repository Path**: lzz42/asm ## Basic Information - **Project Name**: Asm - **Description**: 学习汇编语言的测试代码和学习笔记 - **Primary Language**: 汇编 - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-05-08 - **Last Updated**: 2022-09-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: 汇编 ## README # Asm ## 介绍 - 汇编语言学习实践项目 ## 常见问题 - 1.编译x64时出现语法错误:“error A2008: syntax error : .” - 参考:https://stackoverflow.com/questions/64302264/visual-studio-c-c-project-with-masm-code-produces-error-error-a2008-syntax-e?noredirect=1 - 原因:这些指令:.model、.stack、.XXX等等以及INVOKE、END main在64为MASM下是不支持的 - 64位代码模式下只能假定为:flat,而且调用约定:CDECL/STDCALL/THISCALL/FASTCALL等都是一样的且遵守[x64 calling convention](https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-160&viewFallbackFrom=vs-2019) - 解决方案: - 1.构建32位应用程序,将x64改为x86 - 2.修改代码,依据Windows 64-bit Calling Convention规则修改代码 - 使用CALL调用代替INVOKE - 删除指令:.STACK,.MODEL,.386 - 修改扩展程序声明方式:从`ExitProcess PROTO dxExitCode:DWORD`修改为`extern ExitProcess:PROC` - 添加主程序声明:`public main` - 2.Error A2006 : undefined symbol : DGROUP - 符号没有定义 - - 3.A2074 cannot access label through segment registers - 在段寄存器中不能存取标记