-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsort.asm
More file actions
44 lines (36 loc) · 761 Bytes
/
sort.asm
File metadata and controls
44 lines (36 loc) · 761 Bytes
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
36
37
38
39
40
41
42
43
44
; The Little script for sorting messed data
; and it will locate sorted data in dataloc
; datalong for datalenght
dataloc equ 010h
datalong equ 0Ch
mov dptr,#table
mov r2,#00h
mov r3,#00h
mov r4,#dataloc
sorting:
mov a,r2
movc a,@a+dptr
mov r5,a
x: clr c
mov a,r3
movc a,@a+dptr
mov b,a
mov a,r5
subb a,b
jb c,y
pp: inc r3
clr c
cjne r3,#datalong,x
mov 40h,r4
mov r0,40h
mov 40h,r5
mov @r0,40h
inc r2
mov r4,#dataloc
mov r3,#00h
cjne r2,#datalong,sorting
jmp en
y: inc r4
jmp pp
table:db 64,245,11,111,1,23,121,56,78,34,12,90
en: end