妈呀,微机要考试了,背代码
Posted 宋建楠
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了妈呀,微机要考试了,背代码相关的知识,希望对你有一定的参考价值。
STACK1 SEGMENT STACK
DW 256 DUP(?)
STACK1 ENDS
DATA SEGMENT
MES DB ‘Press any key to exit!‘,0AH,0DH,0AH,0DH,‘$‘
MES1 DB ‘SHOW A AS HEX:‘,0AH,0DH,‘$‘
SD DB ‘a‘
DATA ENDS
CODE SRGMENT
ASSUME CS:CODE,DS:DATA
START:MOVE AX,DATA
MOV DS,AX
MOV DX,OFFSET MES
MOV AH,09H
INT 21H
MOV DX,OFFSET MES1
MOV AH,09H
INT 21H
MOV SI,OFFSET SD
MOV AL,DS:[SI]
AND AL,0F0H
MOV CL,4
SHR AL,CL
CMP AL,0AH
JB C2
ADD AL,07H
C2:ADD AL,30H
MOV DL,AL
MOV AH,02H
INT 21H
MOV AL,DL:[SI]
AND AL,0FH
CMP AL,0AH
JB C3
ADD AL,07H
C3:ADD AL,30H
MOV DL,AL
MOV AH,02H
INT 21H
KEY:MOV AH,1
INT 16H
JZ KEY
MOV AX,4C00H
INT 21H
CODE ENDS
END START
DATA SEGMENT
MSR DB "HELLO,WORLD!$"
LEN EQU $- MSR
DATA ENDS
EXDA SEGMENT
MSD DB LEN DUP(?)
EXDA ENDS
MYSTACK SEGMENT STACK
DW 20 DUP(?)
MYSTACK ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:EXDA
START: MOV AX,DATA
MOV DS,AX
MOV AX,EXDA
MOV ES,AX
MOV SI,OFFSET MSR
MOV DI,OFFSET MSD
MOV CX,LEN
NEXT: MOV AL,[SI]
MOV ES:[DI],AL
INC SI
INC DI
DEC CX
JNZ NEXT
PUSH ES
POP DS
MOV DX,OFFSET MSD
MOV AH,9
INT 21H
KEY: MOV AH,1
INT 16H
JZ KEY
MOV AX,4C00H
INT 21H
CODE ENDS
END START
以上是关于妈呀,微机要考试了,背代码的主要内容,如果未能解决你的问题,请参考以下文章