汇编程序---输出26个大写字母(A~Z)
DATAS SEGMENT
DATAS ENDS
STACKS SEGMENT
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
MOV CX,26 ;设置循环次数
MOV DL,'A' ;设置起始输出字母
LOOP1:
MOV AH,02H
INT 21H
ADD DL,1
LOOP LOOP1 ;LOOP与CX相关联
;此处相当于
; DEC CX
; CMP CX,0
; JA LOOP1
MOV AH,4CH
INT 21H
CODES ENDS
END START
运行结果: