Skip to content

Commit dfca247

Browse files
committed
qsort WIP
1 parent 4a9a40b commit dfca247

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

asm/qsort_mk8.asm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ right=12
3838
pivot=13
3939
first=14
4040
last=15
41-
ab=20
41+
array=20
4242
sb=999
4343

4444
# this stack grows down!
@@ -51,8 +51,8 @@ main:
5151
lit sb to s
5252
call load-data
5353

54-
lit 0 push-s
55-
load n sub 1 push-s
54+
lit array push-s # left
55+
lit array add n sub 1 push-s # right
5656
call sort
5757
call show
5858
hlt 0
@@ -102,7 +102,7 @@ sort:
102102

103103
load-data:
104104
in 0 to n
105-
lit ab to a
105+
lit array to a
106106
load n to i
107107
load_loop:
108108
load i jz load_loop_end
@@ -113,7 +113,7 @@ load-data:
113113

114114
show:
115115
load n to i
116-
lit ab to a
116+
lit array to a
117117
show_loop:
118118
load i jz show_end
119119
peek a out 0 inc a dec i

0 commit comments

Comments
 (0)