一个极简单的汇编问题
我刚学汇编,老师给出了几个题,想请教一下大家.一数据段定义为DATASEGMENTS1DB0,1,2,3,4,5S2DB'12345'CONTEQU$-S1NBDB3DU...
我刚学汇编,老师给出了几个题,
想请教一下大家.
一数据段定义为
DATA SEGMENT
S1 DB 0,1,2,3,4,5
S2 DB'12345'
CONT EQU $-S1
NB DB 3 DUP(2)
NW DW 120,-256
P DW -1
DATA ENDS
1)画出该数据段中数据的存储形式,
3)改正下列和序中不正确指令的错误,
a. MOV AX,S1
b. MOV BP,OFFSET S2
MOV CL,[BP]
c. MOV SI,OFFSET NB
MOV[SI],'+'
d. MOV DL,NW+2
e. MOV DL,CH
f. INC COUNT
先就这些吧,有谁能帮我解决呢?谢谢了! 展开
想请教一下大家.
一数据段定义为
DATA SEGMENT
S1 DB 0,1,2,3,4,5
S2 DB'12345'
CONT EQU $-S1
NB DB 3 DUP(2)
NW DW 120,-256
P DW -1
DATA ENDS
1)画出该数据段中数据的存储形式,
3)改正下列和序中不正确指令的错误,
a. MOV AX,S1
b. MOV BP,OFFSET S2
MOV CL,[BP]
c. MOV SI,OFFSET NB
MOV[SI],'+'
d. MOV DL,NW+2
e. MOV DL,CH
f. INC COUNT
先就这些吧,有谁能帮我解决呢?谢谢了! 展开
展开全部
1)该数据段中数据的存储形式为:
S1|00H|
````|01H|
````|02H|
````|03H|
````|04H|
````|05H|
S2|31H|
````|32H|
````|33H|
````|34H|
````|35H|
NB|02H|
````|02H|
````|02H|
NW|78H|
````|00H|
````|00H|
````|FFH|
P`|FFH|
````|FFH|
3)
a. MOV AX,S1;改为MOV AL,S1或MOV AX, WORD PTR S1
b. MOV BP,OFFSET S2
MOV CL,[BP];改为MOV CL,DS:[BP]
c. MOV SI,OFFSET NB
MOV[SI],'+';改为MOV BYTE PTR [SI],'+'
d. MOV DL,NW+2;改为MOV DL,BYTE PTR NW+2或者MOV DX,NW+2
e. MOV DL,CH;正确
f. INC COUNT;用EQU定义的COUNT不能用指令改变
S1|00H|
````|01H|
````|02H|
````|03H|
````|04H|
````|05H|
S2|31H|
````|32H|
````|33H|
````|34H|
````|35H|
NB|02H|
````|02H|
````|02H|
NW|78H|
````|00H|
````|00H|
````|FFH|
P`|FFH|
````|FFH|
3)
a. MOV AX,S1;改为MOV AL,S1或MOV AX, WORD PTR S1
b. MOV BP,OFFSET S2
MOV CL,[BP];改为MOV CL,DS:[BP]
c. MOV SI,OFFSET NB
MOV[SI],'+';改为MOV BYTE PTR [SI],'+'
d. MOV DL,NW+2;改为MOV DL,BYTE PTR NW+2或者MOV DX,NW+2
e. MOV DL,CH;正确
f. INC COUNT;用EQU定义的COUNT不能用指令改变
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询