汇编常见错误解决方法总结

Posted cway

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了汇编常见错误解决方法总结相关的知识,希望对你有一定的参考价值。

汇编常见错误总结

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
小模式下简化段定义的缺省值
技术图片

以上是关于汇编常见错误解决方法总结的主要内容,如果未能解决你的问题,请参考以下文章

C语言常见问题总结

MySQL常见错误分析与解决方法总结

mysql Access denied for user root@localhost错误解决方法总结(转)

BootStrap有用代码片段(持续总结)

BootStrap实用代码片段(持续总结)

Windows 常见错误总结