Created
November 9, 2017 09:50
-
-
Save MericBERBER/1fe8c2141fdf906004178a853f988158 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 DX, 2000h | |
MOV ES, DX | |
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 | |
LEA SI, STR | |
PRINT: | |
MOV AL, [SI] | |
MOV AH, 0Eh | |
INT 10h | |
INC SI | |
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