1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| STACKS SEGNMENT STACK DW 100H DUP(?) TOP LEABL WORD STACKS ENDS
CODES SEGMENT ASSUME CS:CODES,SS:STACKS MOV AX,STACKS MOV SS,AX LEA SP,TOP
XOR BX,BX L1: MOV AH,1 INT 21H
CMP AL,24H --判断是否为‘$’,是则结束 JZ FOUT CMP AL,41H --判断是否大于A,否则判断下一字符 JB L1 CMP AL,7AH --判断是否小于z,否则判断下一字符 JZ L1 CMP AL,61H --判断是否大于a,是则跳转使得BX自加1 JA FADD CMP AL,5AH --判断是否小于Z,是则跳转使得BX自加1 JB FADD JMP L1 FADD: INC BX JMP L1
FOUT: MOV AH,4CH INT 21H MAIN ENDP CODES ENDS END MAIN
|