匯編常見錯誤總結
0
Block nesting error
嵌套出錯.嵌套的過程,段,結構,宏指令或重復塊等非正常結束.例如在嵌套語句中有外層的結束語句,而無
內層的結束語局
1
Extra characters on line
一語句行有多余字符,可能是語句中給出的參數太多
2
Internal error-Register already defined
這是一個內部錯誤.如出現該錯誤,請記下發生錯誤的條件,並使用Product Assistance Request 表與
Microsoft公司聯系
3
Unkown type specifer
未知的類型說明符.例如類型字符拼錯,把BYTE寫成BIT,NEAR寫成NAER等
4
Redefinition of symbol
符號重定義.同一標識符在兩個位置上定義.在匯編第一遍掃描時,在這個標識符的第二個定義位置上給出
這個錯誤
5
Symbol is multidefined
符號多重定義.同一標識符在兩個位置上定義.在匯編第二遍掃描時,每當遇到這個標識符都給出這個錯誤
6
Phase error between passes
兩次掃描間的遍錯.一個標號在二次掃描時得到不同的地址值,就會給出這種錯誤.若在啟動MASM時使用/D
任選項,產生第一遍掃描的列表文件,它可幫助你查找這種錯誤
7
Already had ELSE clause
已有ELSE語句.在一個條件塊里使用多於一個的ELSE語句
8
Must be in conditional block
沒有在條件塊里.通常是有ENDIF或ELSE語句,而無IF 語句
9
Symbol not defined
符號未定義,在程序中引用了未定義的標識符
10
Syntax error
語法錯誤.不是匯編程序所能識別的一個語句
11
Type illegal in context
指定非法類型.例如對一個過程指定BYTE類型,而不是NEAR或FAR
12
Group name must be unique
組名應是唯一的.作為組名的符號作為其他符號使用
13
Must be declared during pass 1
必須在第一遍掃描期間定義.在第一遍掃描期間,如一個符號在未定義前就引用,就會出現這種錯誤.
14
Illegal public declaration
一個標識符被非法的指定為PUBLIC類型
15
Symbol already defferent kind
重新定義一個符號為不同種類符號.例如一個段名重新被當作變量名定義使用
16
Reserved word used as symbol
把匯編語言規定的保留字作標識符使用
17
Forward reference illegal
非法的向前引用.在第一遍掃描期間,引用一個未定義符號.
18
Operand must be register
操作數位置上應是寄存器,但出現了標識符
19
Wrong type of register
使用寄存器出錯
20
Operand must be segment or group
應該給出一個段名或組名.例如ASSUME語句中應為某段寄存器和指定一個段名或組名,而不應是別的標號或
變量名等
21
Symbol has no segment
不知道標識符的段屬性
22
Operand must be type specifier
操作數應給出類型說明,如NEAR,FAR,BYTE等
23
Symbol alread defined locally
以被指定為內部的標識符,企圖在EXTRN語句中又定義外部標識
24
Segment paraneters are changed
段參數被改變.如同一標識符定義在不同段內
25
Improper align/combin type
段定義時的定位類型/組合類型使用出錯
26
Reference to multidefined symbol
指令引用了多重定義的標識符
27
Operand expected
需要一個操作數,只有操作符
28
Operator expected
需要一個操作符,但只有操作數
29
Divdsion by 0 or overflow
除以0或溢出
30
Negative shift count
運算符SHL或SHR的移位表達式值為負數
31
Operand type must match
操作數類型不匹配.雙操作數指令的兩個操作數長度不一致,一個是字節,一個是字
32
Illegal use of external
外部符號使用出錯
33
Must be record field name
應為記錄字段名.在記錄字段名位置上出現另外的符號
34
Must be record name or field name
應為記錄名或記錄字段名.在記錄名或記錄字段名位置上出現另外的符號
35
Operand must be size
應指明操作數的長度(如BYTE,WORD等).通常使用PTR運算即可改正
36
Must be variable,label,or constant
應該是變量名,標號,或常數的位置上出現了其他信息
37
Must be stucture field name
應該為結構字段名.在結構字段名位置上出現了另外的符號
38
Lefe operand must segment
操作數的左邊應該是段的信息.如設DA1,DA2均是變量名,下列語句就是錯誤的:"MOV AX,DA1:DA2".DA1位置
上應使用某段寄存器名
39
One operand must constant
操作數必須是常數.
40
Operand must be in same segment or one constant
"—"運算符用錯.例如"MOV AL,—VAR",其中VAR是變量名,應有一常數參加運算.又如兩個不同段的變量名
相減出錯
41
Normal type operand expected
要求給出一個正常的操作數.
42
Constant expected
要求給出一個常數.
43
Operand must have segment
運算符SEG用錯.
44
Must be associated with data
在必須與數據段有關的位置上出現了代碼段有關的項
45
Must be associated with code
在必須與代碼段有關的位置上出現了數據段有關的項
46
Multiple base registers
同時使用了多個基址寄存器.如"MOV AX ,[SI][BP]"
47
Multiple index registers
同時使用了多個變址寄存器.如"MOV AX ,[SI][DI]"
48
Must be index or base register
指令僅要求使用基址寄存器或變址寄存器,而不能使用其他寄存器.
49
Illegal use of register
非法使用寄存器出錯
50
Value is out of range
數值太大,超過允許值.例如:"MOV AL ,100H"
51
Operand not in current CS ASSUME segment
操作數不在當前代碼段內.通常指轉移指令的目標地址不在當前CS段內
52
Improper operand type
操作數類型使用不當.例如:"MOV VAR1,VAR2".兩個操作數均為存儲器操作數,不能匯編出目標代碼
53
Jump out of range by %ld byte
條件轉移指令跳轉范圍超過-128~ 127個字節.出錯廠,信息同時給出超過的字節數
54
Index displacement must be constant
變址尋址的位移量必須是常數
55
Illegal register value
非法的寄存器值.目標代碼中表達寄存器的值超過7
56
Immediate mode illegal
不允許使用立即數尋址.例如"MOV DS,CODE"其中CODE是段名,不能把段名作為立即數傳送給段寄存器DS
57
Illegal size for operand
使用操作數大小(字節數)出錯.例如:使用雙字的存儲器操作數
58
Byte register illegal
要求用字寄存器的指令使用了字節寄存器.如PUSH,POP指令的操作數寄存器必須是字寄存器
59
Illegal uer of CS register
指令中錯誤使用了段寄存器CS.如:"MOV CS,AX"CS不能做目的操作數
60
Must be accumulator register
要求用AX或AL的位置上使用可其他寄存器.如IN,OUT指令必須使用累加器AX或AL
61
Improper uer of segment register
不允許使用段寄存器的位置上使用了段寄存器.如"SHL DS,1"
62
Missing or unreachable CS
試圖跳轉去執行一個CS達不到的標號.通常是指缺少ASSUME語句中CS與代碼段相關聯
63
Operand combination illegal
雙操作數指令中兩個操作數組合出錯
64
Near JMP/CALL to different CS
試圖用NEAR屬性的轉移指令跳轉到不在當前段的一個地址
65
Label cannot have segment override
段前綴使用出錯
66
Must have instuction agter prefix
在重復前綴REP,REPE,REPNE后面必須有指令
67
Cannot override ES for destination
串操作指令中目的操作數不能用其他段寄存器替代ES
68
Cannot address with srgment register
指令中尋找一個操作數,但ASSUME語句中未指明哪個段寄存器與該操作數所在段有關聯
69
Must be in segment block
指令語句沒有在段內
70
Cannot use EVEN or ALIGN with byte alignment
在段定義偽指令的定位類型中選用BYTE,這時不能使用EVEN或ALIGN偽指令
71
Forward needs override or FAR
轉移指令的目標沒有在源程序中說明為FAR屬性,可用PTR指定
72
Illegal value for DUP count
操作符DUP前的重復次數是非法的或未定義
73
Symbol id already external
在模塊內試圖定義的符號,它已在外部符號偽指令中說明
74
DUP nesting too deep
操作數DUP的嵌套太深
75
Illegak use of undefinde operand( )
不定操作符" "使用不當.例如"DB 10H DUP( 2)"
76
Too many valer for struc or record initialization
在定義結構變量或記錄變量時,初始值太多
77
Angle brackets requored around initialized list
定義結構體變量時,初始值未用尖括號()括起來
78
Directive illegal structure
在結構體定義中的偽指令使用不當.結構定義中的偽指令語句僅二種:分號(;)開始的注釋語句和用DB,DW等
數據定義偽指令語句
79
Override with DUP illegal
在結構變量初始值表中使用DUP操作符出錯
80
Field cannot be overridden
在定義結構變量語句中試圖對一個不允許修改的字段設置初值
81
Override id of wrong type
在定義結構變量語句中設置初值時類型出錯
82
Circular chain of EQU aliases
用等值語句定義的符號名,最后又返回指向它自己.如:
A EQU B
B EQU A
83
Cannot emulate cooprocessor opcode 仿真器不能支持的8087協處理器操作碼
84
End of file,not END directive 源程序文件無END文件
85
Data emitted with no segment 語句數據沒有在段內
86 can't open ml.err
把下面的復制到一個文檔,命名為ml.err添加到工程目錄
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
87
加上.386之后出現亂碼
應該在.model語句之后加.386
使用的是 Masm 的話,這里有個約定。對 dos16 類的程序,需要在 .386 語句之前,加上個 .model small 之類的語句;否則,將會以 32 位的模式來創建指令,這樣的代碼在 16 位模式下運行,自然就是錯大了。
88
小模式下簡化段定義的缺省值
89
定義堆棧段之后編譯仍然出現
warning L4021: no stack segment
解決辦法:
在段定義后面加上STACK
這里STACK是對其類型的意思,具體可以參考這篇文章