求高手指教这个代码那出问题了

China-Allen 2013-09-23 10:00:21
               .386
.model flat,stdcall
option casemap:none
;include文件定义
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
;equ等值定义
;equ等值定义
ICO_MAIN equ 1000
DLG_MAIN equ 1000
IDC_COUNTER1 equ 1001
IDC_COUNTER2 equ 1002
;数据段
.data?
hInstance dd ?
hWinMain dd ?
hWinCount dd ?
dwThreads dd ?

dwOption dd ?
F_STOP equ 0001h

dwCounter1 dd ?
dwCounter2 dd ?
.const
szStop db '停止计数',0
szStart db '计数',0
;代码段
.code
_Counter proc uses ebx esi edi,_lParam

inc dwThreads
invoke SetWindowText,hWinCount,addr szStop
and dwOption,not F_STOP

.while !(dwOption & F_STOP)
inc dwCounter1
mov eax,dwCounter2
inc eax
mov dwCounter2,eax
.endw
dec dwThreads
invoke SetWindowText,hWinCount,addr szStart
ret
_Counter endp

_ProcDlgMain proc uses ebx edi esi hWnd,wMsg,wParam,lParam
local @dwThreadID

mov eax,wMsg
.if eax == WM_TIMER
invoke SetDlgItemInt,hWinMain,IDC_COUNTER1,dwCounter1,FALSE
invoke SetDlgItemInt,hWinMain,IDC_COUNTER2,dwCounter2,FALSE
.elseif eax == WM_COMMAND
mov eax,wParam
.if ax == IDOK
.if dwThreads
or dwOption,F_STOP
invoke KillTimer,hWnd,1
.else
mov dwCounter1,0
mov dwCounter2,0
xor ebx,ebx
.while ebx < 10
invoke CreateThread,NULL,0,offset _Counter,NULL,NULL,addr @dwThreadID
invoke CloseHandle,eax
inc ebx
.endw
invoke SetTimer,hWnd,1,500,NULL
.endif
.endif
.elseif eax == WM_CLOSE
.if ! dwThreads
invoke EndDialog,hWnd,NULL
.endif
.elseif eax == WM_INITDIALOG
push hWnd
pop hWinMain
invoke GetDlgItem,hWnd,IDOK
mov hWinCount,eax
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
_ProcDlgMain endp
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,hInstance,DLG_MAIN,NULL,offset _ProcDlgMain,NULL
invoke ExitProcess,NULL
end start

这个是错误提示
Assembling: 1.asm
error A4910: cannot open file: E:\toolbox\EditGear\masm32\Bin\ml.err
1.asm(1) : error A2085:
1.asm(1) : error A2039:
1.asm(1) : error A2088:
NMAKE : fatal error U1077: 'ml' : return code '0x1'
Stop.
...全文
3478 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zara 2013-09-23
  • 打赏
  • 举报
回复
源程序本身没有问题吧。
从错误提示来看,你的 masm32 少了 ml.err 错误信息文件,这样出现汇编警告和错误时,就只能提示类型编号而没有具体的描述了,所以得复制个 ml.err 文件来。
从那几个错误代码,怀疑你的源程序首行的 .386 之前,是不是有其它内容?或者,你将源程序保存为非 ascii 格式了?
Explorerlxz 2013-09-23
  • 打赏
  • 举报
回复
FATAL
cannot open file
I/O error closing file
I/O error writing file
I/O error reading file
out of memory
assembler limit : macro parameter name table full
invalid command-line option
nesting level too deep
unmatched macro nesting
line too long
unmatched block nesting
directive must be in control block
error count exceeds 100; stopping assembly
invalid numerical command-line argument
too many arguments
statement too complex
Internal Assembler Error
missing source filename
COFF error writing file
invalid debug and browser data; file exceeds line limit
cannot find link.exe
cannot find cvpack.exe
SEVERE
memory operand not allowed in context
immediate operand not allowed
cannot have more than one ELSE clause per IF block
extra characters after statement
symbol type conflict
symbol redefinition
undefined symbol
non-benign record redefinition
syntax error
syntax error in expression
invalid type expression
distance invalid for word size of current segment
PROC, MACRO, or macro repeat directive must precede LOCAL
.MODEL must precede this directive
cannot define as public or external
segment attributes cannot change
expression expected
operator expected
invalid use of external symbol
operand must be RECORD type or field
identifier not a record
record constants may not span line breaks
instruction operands must be the same size
instruction operand must have size
invalid operand size for instruction
operands must be in same segment
constant expected
operand must be a memory expression
expression must be a code address
multiple base registers not allowed
multiple index registers not allowed
must be index or base register
invalid use of register
invalid INVOKE argument
must be in segment block
DUP too complex
too many initial values for structure
statement not allowed inside structure definition
missing operand for macro operator
line too long
segment register not allowed in context
string or text literal too long
statement too complex
identifier too long
invalid character in file
missing angle bracket or brace in literal
missing single or double quotation mark in string
empty (null) string
nondigit in number
syntax error in floating-point constant
real or BCD number not allowed
text item required
forced error
forced error : value equal to 0
forced error : value not equal to 0
forced error : symbol not defined
forced error : symbol defined
forced error : string blank
forced error : string not blank
forced error : strings equal
forced error : strings not equal
[ELSE]IF2/.ERR2 not allowed : single-pass assembler
expression too complex for .UNTILCXZ
can ALIGN only to power of 2
structure alignment must be 1, 2, 4, 8, or 16
expected
incompatible CPU mode and segment size
LOCK must be followed by a memory operation
instruction prefix not allowed
no operands allowed for this instruction
invalid instruction operands
initializer magnitude too large for specified size
cannot access symbol in given segment or group
operands have different frames
cannot access label through segment registers
jump destination too far
jump destination must specify a label
instruction does not allow NEAR indirect addressing
instruction does not allow FAR indirect addressing
instruction does not allow FAR direct addressing
jump distance not possible in current CPU mode
missing operand after unary operator
cannot mix 16- and 32-bit registers
invalid scale value
constant value too large
instruction or register not accepted in current CPU mode
reserved word expected
instruction form requires 80386/486
END directive required at end of file
too many bits in RECORD
positive value expected
index value past end of string
count must be positive or zero
count value too large
operand must be relocatable
constant or relocatable label expected
segment, group, or segment register expected
segment expected
invalid operand for OFFSET
invalid use of external absolute
segment or group not allowed
cannot add two relocatable labels
cannot add memory expression and code label
segment exceeds 64K limit
invalid type for a data declaration
HIGH and LOW require immediate operands
N/A
cannot have implicit far jump or call to near label
use of register assumed to ERROR
only white space or comment can follow backslash
COMMENT delimiter expected
conflicting parameter definition
PROC and prototype calling conventions conflict
invalid radix tag
INVOKE argument type mismatch : argument
invalid coprocessor register
instructions and initialized data not allowed in AT segments
/AT switch requires the TINY memory model
cannot have segment address references with TINY model
language type must be specified
PROLOGUE must be macro function
EPILOGUE must be macro procedure
alternate identifier not allowed with EXTERNDEF
text macro nesting level too deep
N/A
missing macro argument
EXITM used inconsistently
macro function argument list too long
N/A
VARARG parameter must be last parameter
VARARG parameter not allowed with LOCAL
VARARG parameter requires C calling convention
ORG needs a constant or local offset
register value overwritten by INVOKE
structure too large to pass with INVOKE : argument
not overriding private proc as public
too many arguments to INVOKE
too few arguments to INVOKE
invalid data initializer
N/A
RET operand too large
too many operands to instruction
cannot have more than one .ELSE clause per .IF block
expected data label
cannot nest procedures
EXPORT must be FAR
procedure declared with two visibility attributes
macro label not defined
invalid symbol type in expression
byte register cannot be first operand
word register cannot be first operand
special register cannot be first operand
coprocessor register cannot be first operand
cannot change size of expression computations
syntax error in control-flow directive
cannot use 16-bit register with a 32-bit address
constant value out of range
missing right parenthesis
type is wrong size for register
structure cannot be instanced
non-benign structure redefinition: label incorrect
non-benign structure redefinition: too few labels
OLDSTRUCTS/NOOLDSTRUCTS state cannot be changed
non-benign structure redefinition: incorrect initializers
non-benign structure redefinition: too few initializers
non-benign structure redefinition: label has incorrect offset
structure field expected
unexpected literal found in expression
N/A
divide by zero in expression
directive must appear inside a macro
cannot expand macro function
too few bits in RECORD
macro function cannot redefine itself
N/A
invalid qualified type
floating-point initializer on an integer variable
nested structure improperly initialized
invalid use of FLAT
structure improperly initialized
improper list initialization
initializer must be a string or single item
initializer must be a single item
initializer must be a single byte
improper use of list initializer
improper literal initialization
extra characters in literal initialization
must use floating-point initializer
cannot use .EXIT for OS_OS2 with .8086
invalid combination with segment alignment
INVOKE requires prototype for procedure
cannot include structure in self
symbol language attribute conflict
non-benign COMM redefinition
COMM variable exceeds 64K
parameter or local cannot have void type
cannot use TINY model with OS_OS2
expression size must be 32 bits
.EXIT does not work with 32-bit segments
.STARTUP does not work with 32-bit segments
ORG directive not allowed in unions
D/T
illegal use of segment register
cannot declare scoped code label as PUBLIC
.MSFLOAT directive is obsolete : .MSFLOAT ignored
ESC instruction is obsolete : ESC ignored
missing operator in expression
missing right parenthesis in expression
missing left parenthesis in expression
reference to forward macro definition
16 bit segments not allowed with /coff option
FAR not allowed in flat model comm variables
invalid .model parameter for flat model
ALIAS name is empty
GROUP directive not allowed with /coff option
.FPO is not compatible with nested procedures
LEVEL 1
cannot modify READONLY segment
N/A
non-unique STRUCT/UNION field used without qualification
start address on END directive ignored with .STARTUP
cannot ASSUME CS
unknown default prologue argument
too many arguments in macro call
option untranslated, directive required
invalid command-line option value, default is used
insufficent memory for /EP : /EP ignored
expected '>' on text literal
multiple .MODEL directives found : .MODEL ignored
line number information for segment without class 'CODE'
instructions and initialized data not supported in AT segments
instructions and initialized data not supported in BSS segments
directive ignored with /coff switch
/Gc switch incompatible with flat model
/AT switch incompatible with flat model
invalid command-line option
directive ignored without /coff switch
directive ignored outside a procedure
LOADDS ignored in flat model
debug information too complex for 
with /coff switch, leading underscore required for start address
LEVEL 2
@@: label defined but not referenced
expression expected, assume value 0
EXTERNDEF previously assumed to be external
length of symbol previously assumed to be different
symbol previously assumed to not be in a group
types are different
calling convention not supported in flat model
LEVEL 3
N/A
no return from procedure
N/A
conditional jump lengthened
procedure argument or local not referenced
expression may be pass-dependent
structure contains no members
把上面的代码保存为ml.err放到bin目录下即可!不必重新安装
Explorerlxz 2013-09-23
  • 打赏
  • 举报
回复
我上次也遇到error A4910: cannot open file: D:\masm32\Bin\ml.err 当时因为重装系统不知怎么搞的没有ml.err了,我重新装了一下masm32然后就好了! 程序本身应该没有问题,不过这个程序本身就是问题程序,运行时会出现无法关闭的情况,用任务管理器关掉就行了!我把上面的代码加上罗云彬的配套资源文件,图标,makefile文件放到一起,编译成功!

21,459

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧