mmicroprocessor.blogspot.com
mmicroprocessor.blogspot.com
mmicroprocessor.blogspot.com
.model small
.data
list db
90h,3ah,80h,40h
SA DB ?
.code
.startup
mov cl,0
p1:XOR BX,BX
MOV BL,CL
mov al,LIST[BX]
MOV SI,BX
mov ch,0
p2:
XOR BX,BX
MOV BL,CH
mov dl,LIST[BX]
cmp al,dl
jbe mn
jmp m1
mn:
mov al,LIST[SI]
MOV DL,LIST[BX]
xchg al,Dl
mov LIST[SI],al
mov LIST[BX],dl
m1:
inc ch
cmp ch,CL
jB p2
inc cl
cmp cl,4
jNZ p1
mov cl,0
pp:
XOR BX,BX
MOV BL,CL
MOV AL,LIST[BX]
MOV DL,AL
ROL DL,4
AND DL,0FH
ADD DL,30H
cmp dl,'9'
jbe f1
add dl,7h
f1:
MOV AH,02H
INT 21H
MOV AL,LIST[BX]
AND AL,0FH
MOV DL,AL
ADD DL,30H
cmp dl,'9'
jbe f2
add dl,7
f2:
MOV AH,02H
INT 21H
INC CL
CMP CL,4
JNZ pp
MOV AH,4CH
INT 21H
End
Output:
3A408090
No comments:
Post a Comment