嚴重性 代碼 說明 專案 檔案 行 禁止顯示狀態
錯誤 MSB3721 命令“ml.exe /c /nologo /Zi /Fo"Debug\cool22.obj" /W3 /errorReport:prompt /TaD:\Irvine\Irvine\irvine\examples\Lib64\cool22.asm”已退出,回傳代碼為 1。 dog C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets 70
錯誤 A1010 unmatched block nesting : main dog D:\Irvine\Irvine\irvine\examples\Lib64\cool22.asm 63
。。。。。。
錯誤 A2034 must be in segment block : main dog D:\Irvine\Irvine\irvine\examples\Lib64\cool22.asm 35
嚴重性 代碼 說明 專案 檔案 行 禁止顯示狀態
錯誤 A2013 .MODEL must precede this directive dog D:\Irvine\Irvine\irvine\examples\Lib64\cool22.asm 8
GetConsoleScreenBufferInfo Proto
GetStdHandle Proto
WriteConsoleOutputCharacter proto
SetConsoleCursorPosition proto
ExitProcess proto
WriteString proto
max = 100;最大單行位元組數
.data
kong byte max dup (' ')
consoleInHandle qword ?
consoleOutHandle qword ?
nb qword ?
STD_OUTPUT_HANDLE equ -11
COORD STRUCT
X WORD ?
Y WORD ?
COORD ENDS
SMALL_RECT STRUCT
Left word ?
Top word ?
Right word ?
Bottom word ?
SMALL_RECT ends
CONSOLE_SCREEN_BUFFER_INFO STRUCT
dwsize COORD<>
dwCursorPosition COORD<>
wAttributes word ?
srWindow SMALL_RECT<>
dwMaximumWindowSize COORD <>
CONSOLE_SCREEN_BUFFER_INFO ENDS
.code
main proc
sub rsp,8
sub rsp,40
mov rcx,STD_OUTPUT_HANDLE
call GetStdHandle
mov consoleOutHandle,rax
mov rcx,consoleOutHandle
mov rdx,offset CONSOLE_SCREEN_BUFFER_INFO
CALL GetConsoleScreenBufferInfo
MOV RDI,OFFSET CONSOLE_SCREEN_BUFFER_INFO.dwCursorPosition
MOV RCX,QWORD PTR (COORD PTR [RDI]).Y
L2:
mov rcx,consoleOutHandle
mov rdx,offset kong
mov r8,qword ptr (COORD ptr [rdi]).X
mov (COORD ptr [rdi]).X,0
mov r9,rdi
mov qword ptr [rsp + 4 * sizeof qword],nb
call WriteConsoleOutputCharacter
dec (COORD PTR [RDI]).Y
loop L2
mov COORD.Y,0
mov rcx,consoleOutHandle
mov rdx,offset COORD
call SetConsoleCursorPosition
mov ecx,0
call ExitProcess
add rsp,40
main endp
end
uj5u.com熱心網友回復:
被邀而來。我沒做過 masm64類的,手頭也沒 2019,所以無法實證。
照第 3 個錯誤提示,第 8 行前應該有 .MODEL 陳述句的,前面的兩個錯誤可能就是因此而來。32 位的在原始碼的開始要有下面這樣的說明的,你也可以看看是不是有示例原始碼,它們的基本的源程式框架。
.586
.MODEL flat,stdcall
option casemap:none
uj5u.com熱心網友回復:
我的問題就是64位匯編沒有加這些的格式啊
uj5u.com熱心網友回復:
64位的沒這些格式?那個提示明確要求要有,那就是你用錯了編譯工具,或設定錯了工程的模式型別?看命令列的提示確實是在 32 位的 Program Files (x86) 目錄下的。我沒用過 vs 的,不知道具體步驟。不過,可以試試命令列視窗下在 Program Files 目錄下找找 ml.exe 在哪個目錄,手工編譯下看看。轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/244888.html
標籤:匯編語言
上一篇:TypeError: create_task() got an unexpected keyword argument 'name'
下一篇:新手教程中,請各位大佬解答。
