汇编语言几道考试题目,高手来帮忙

2025-01-20 17:00:57
推荐回答(1个)
回答1:

1、
(1)子程序的功能是判断AL和BL是否异号,若异号则将二者值交换
(2)返回主程序时,(AL)=77H(BL)=9AH
2、
a)
[JNS L2]----第1空
L2:[SHL AX,1]----第2空
b)
[MOV CX,CUNT ]---第3空
[ADD AL,30H ]---第4空
[ LOOP LOP]---第5空
3、程序设计
1)
DATA SEGMENT
X1 DB 12H
X2 DB 34H
MA DB ?
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV AL,X1
CMP AL,X2
JAE TJ
MOV AL,X2
TJ:
MOV MA,AL
MOV AX,4C00H
INT 21H
CODE ENDS
END START
2)
DATA SEGMENT
A DB 12,32,44,24,55,65,73,23,21,26,78,87,57,83,22
B DB 32,44,54,65,24,35,88,97,45,43,67,87,22,34,77,78,99,67,83,10
C DB 15 DUP (?)
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,ES:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV ES,AX
LEA SI,A
LEA BX,C
MOV DX,15
NEXT1:
MOV AL,[SI]
LEA DI,B
MOV CX,20
CLD
REPNE SCASB
JNE NEXT2
MOV [BX],AL
INC BX
NEXT2:
INC SI
DEC DX
JNZ NEXT1
MOV AX,4C00H
INT 21H
CODE ENDS
END START