We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a9a40b commit dfca247Copy full SHA for dfca247
asm/qsort_mk8.asm
@@ -38,7 +38,7 @@ right=12
38
pivot=13
39
first=14
40
last=15
41
-ab=20
+array=20
42
sb=999
43
44
# this stack grows down!
@@ -51,8 +51,8 @@ main:
51
lit sb to s
52
call load-data
53
54
- lit 0 push-s
55
- load n sub 1 push-s
+ lit array push-s # left
+ lit array add n sub 1 push-s # right
56
call sort
57
call show
58
hlt 0
@@ -102,7 +102,7 @@ sort:
102
103
load-data:
104
in 0 to n
105
- lit ab to a
+ lit array to a
106
load n to i
107
load_loop:
108
load i jz load_loop_end
@@ -113,7 +113,7 @@ load-data:
113
114
show:
115
116
117
show_loop:
118
load i jz show_end
119
peek a out 0 inc a dec i
0 commit comments