纯粹出于好奇——为什么不能将变量命名为“c”?例如...
.386
.model flat, stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
includelib user32.lib
includelib kernel32.lib
Main proto
.data
hOutput dd 0
hInput dd 0
bReadWritten dd 0
szText db "Program calculates the roots of the quadratic expression ax^2+bx+c",10,"Enter a",0
a dd 0
b dd 0
c dd 0
delta dd 0
szInput db 128 dup(0)
.data?
.code
start:
Invoke Main
Invoke ExitProcess,0
Main proc
invoke GetStdHandle, STD_OUTPUT_HANDLE
mov hOutput, eax
invoke GetStdHandle,STD_INPUT_HANDLE
mov hInput, eax
invoke lstrlen, addr szText
invoke WriteFile, hOutput, addr szText, eax, ADDR bReadWritten, NULL
invoke ReadFile, hInput, a, eax,addr bReadWritten, NULL
invoke ReadFile, hInput, b, eax,addr bReadWritten, NULL
invoke ReadFile, hInput, c, eax,addr bReadWritten, NULL
invoke Sleep,10000
ret
Main endp
end start
...这会导致组装时错误
C:\3-rd 方程序\winASM\WinAsm\Projects\quadratic equation\EXE.asm(24) : 错误 A2008: 语法错误: c
C:\3-rd 方程序\winASM\WinAsm\Projects\quadratic equation\ EXE.asm(52):错误 A2008:语法错误:c
当我重命名它时,一切都组装并运行良好。