|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
为什么会出现无效指令
下面是代码
assume CS:code,DS:data
data segment
DB "1975","1976","1977","1978","1979","1980","1981","1982","1983"
DB "1984","1985","1986","1987","1988","1989","1990","1991","1992"
DB "1993","1994","1995"
DD 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514
DD 345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000
DW 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226
DW 11542,14430,15257,17800
data ends
table segment
DB 18 dup(" "),0
table ends
stack segment
DB 200 dup(0)
stack ends
code segment
start:
MOV AX,stack
MOV SS,AX
MOV sp,200
MOV AX,data
MOV DS,AX
MOV AX,table
MOV ES,AX
MOV SI,0
MOV DI,0
MOV CX,4
s:
MOV AL,[si]
MOV ES:[di],AL
INC SI
INC DI
LOOP s
MOV SI,0
INC DI
MOV CX,2
MOV AX,[SI+84]
MOV DX,[SI+86]
CALL switch
MOV DH,8
MOV DL,3
MOV CL,2
MOV SI,0
CALL show
MOV AX,4c00h
INT 21h
show:
PUSH DX
PUSH AX
PUSH ES
PUSH SI
PUSH DI
PUSH CX
MOV AX,table
MOV DS,AX
SUB DH,1
MOV AL,DH
MOV BL,0A0h
MUL BL
ADD DL,DL
SUB DL,2
MOV DH,0
ADD AX,DX
MOV bx,0b800h
MOV ES,bx
MOV DI,AX
MOV AL,CL
MOV CH,0
s0:
MOV CL,[si]
JCXZ ok
MOV ES:[di],cL
INC DI
MOV ES:[di],AL
INC SI
INC DI
JMP short s0
ok:
POP CX
POP DI
POP SI
POP ES
POP AX
POP DX
RET
switch:
PUSH DI
PUSH bx
PUSH DX
MOV CX,2
s1:
PUSH CX
MOV DI,0
MOV bx,10
s2:
MOV DX,0
DIV bx
MOV CS,AX————这里出现无效指令
ADD DX,30h
PUSH DX
INC DI
JCXZ s3
JMP short s2
MOV CS,DI
s3:
POP AX
MOV ES:[di],AL
INC DI
LOOP s3
POP AX
POP CX
JCXZ ok1
MOV AX,CX
LOOP s1
ok1:
POP DX
POP bx
POP DI
ret
code ends
end start
MOV CS,AX————这里出现无效指令
cs段寄存器可以直接mov吗?
|
|