50分之汇编之最后一练习题..哈..真的有难度...

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/09 05:11:43

50分之汇编之最后一练习题..哈..真的有难度...
50分之汇编之最后一练习题..哈..真的有难度...

50分之汇编之最后一练习题..哈..真的有难度...
七、
1、DATAS SEGMENT
DA_BYTE1 DB
ORG 100H
DA_BYTE2 DB
DATAS ENDS
STACKS SEGMENT
DW 10 DUP(0)
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
LEA SI,DA_BYTE1
LEA DI,DA_BYTE2
CMP BYTE PTR [SI],0
JG A1
MOV BYTE PTR [DI],0
JMP A2
A1:MOV BYTE PTR [DI],1
A2:MOV AH,4CH
INT 21H
CODES ENDS
END START
2、DATAS SEGMENT
DA_BYTE1 DB
ORG 100H
DA_BYTE2 DB
DATAS ENDS
STACKS SEGMENT
DW 10 DUP(0)
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
LEA SI,DA_BYTE1
LEA DI,DA_BYTE2
MOV AL,[SI]
XCHG AL,[DI]
MOV [SI],AL
MOV AH,4CH
INT 21H
CODES ENDS
END START