Created
November 8, 2017 21:05
-
-
Save MericBERBER/812ba1cda3659979eda559fd2f8b13fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org 100h | |
LEA SI, STR | |
MOV CL, 10 ; 10 ELEMAN VAR | |
MOV BP, 0 | |
LOOP1: | |
MOV SI, BP | |
MOV AL, STR[SI] | |
PUSH CX | |
LOOP2: | |
INC SI | |
MOV BL, STR[SI] | |
CMP AL, BL | |
JA SWAP ; it is sorted array. | |
JMP JUMP | |
SWAP: | |
XCHG STR[BP],BL | |
MOV STR[SI],BL | |
MOV AL, STR[BP] | |
JUMP: | |
LOOP LOOP2 | |
POP CX | |
INC BP | |
LOOP LOOP1 | |
MOVE:;move STR to ES:2000h | |
CLD | |
LEA SI, STR | |
MOV DI, 2000h | |
MOV CX, 10 | |
REP MOVSB | |
MOV CX, 10 | |
MOV DI, 2000h | |
PRINT: | |
MOV AL, ES[DI] | |
MOV AH, 0Eh | |
INT 10h | |
INC DI | |
LOOP PRINT | |
END: | |
ret | |
STR DB 'H', 'F', 'T', 'C', 'B', 'L', 'A', 'S', 'D', 'F' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment