微机原理 数码转换编程实验
发布网友
发布时间:2023-07-30 18:25
我来回答
共1个回答
热心网友
时间:2024-12-01 19:55
DATA SEGMENT
STR1 DB 31H,41H,32H,42H
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX ;初始化DS
LEA SI,STR1
XOR BX,BX
MOV CL,4
MOV CH,4
ASSEMBLE:
SHL BX,CL
MOV AL,[SI]
CMP AL,39H
JBE NEXT1
CMP AL,61H
JBE NEXT2
SUB AL,27H
JMP NEXT1
NEXT2:
SUB AL,07H
NEXT1:
SUB AL,30H
or BL,AL
INC SI
DEC CH
JNZ ASSEMBLE
MOV AH,4CH
INT 21H
CODE ENDS