2023-05-21 00:48:50 +00:00
|
|
|
INCLUDE dos_layer.asm
|
|
|
|
|
|
|
|
.org 0x100
|
|
|
|
mov sp,#STACK
|
|
|
|
MOV SI,#DATA
|
|
|
|
|
|
|
|
GNOME_SORT:
|
2023-11-12 07:28:51 +00:00
|
|
|
CMP SI,#DATA+23
|
2023-05-21 00:48:50 +00:00
|
|
|
JZ GNOMED
|
|
|
|
MOV AX,[SI]
|
|
|
|
INC SI
|
|
|
|
CMP AH,AL
|
|
|
|
JAE GNOME_SORT
|
|
|
|
|
|
|
|
SWAP:
|
|
|
|
MOV BL,AL
|
|
|
|
MOV AL,AH
|
|
|
|
MOV AH,BL
|
|
|
|
DEC SI
|
|
|
|
MOV [SI],AX
|
|
|
|
CMP SI,#DATA
|
|
|
|
JZ GNOME_SORT
|
|
|
|
DEC SI
|
|
|
|
JMP GNOME_SORT
|
|
|
|
|
|
|
|
GNOMED:
|
|
|
|
MOV SI,#DATA
|
|
|
|
PRINT_LOOP:
|
|
|
|
MOV AL,[SI]
|
|
|
|
call PRINT_0_8_HEX
|
|
|
|
INC SI
|
2023-11-12 07:28:51 +00:00
|
|
|
CMP SI,#DATA+24
|
2023-05-21 00:48:50 +00:00
|
|
|
JNZ PRINT_LOOP
|
|
|
|
|
|
|
|
MOV AH,#0x02
|
|
|
|
MOV DL,#0x0a
|
|
|
|
INT #0x21
|
|
|
|
|
|
|
|
hlt
|
|
|
|
|
|
|
|
DATA: DB 0x51, 0x17, 0x37, 0x5d, 0x06, 0x3f, 0x51, 0x8b
|
2023-05-22 21:33:00 +00:00
|
|
|
DB 0xa5, 0x33, 0x54, 0xdf, 0xae, 0xee, 0x3a, 0x18
|
|
|
|
DB 0xe9, 0xdb, 0x1f, 0x21, 0x44, 0x4f, 0x99, 0x09
|
2023-05-21 00:48:50 +00:00
|
|
|
|
|
|
|
.BLKB 200
|
|
|
|
STACK:
|
|
|
|
|
|
|
|
INCLUDE helpers.asm
|
|
|
|
|
|
|
|
.ORG 0xFFF0
|
|
|
|
MOV AX,#0x0100
|
|
|
|
JMP AX
|
|
|
|
|