-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsortx.mms
More file actions
34 lines (32 loc) · 752 Bytes
/
sortx.mms
File metadata and controls
34 lines (32 loc) · 752 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
LOC Data_Segment
x0 GREG @
X0 IS @
N IS 100
j IS $0
m IS $1
kk IS $2
xk IS $3
t IS $255
LOC #100
Maximum SL kk,$0,3
LDO m,x0,kk
JMP ChangeJ
Loop LDO xk,x0,kk
CMP t,m,xk
PBN t,DecreaseK
ChangeM SET m,xk
ChangeJ SR j,kk,3
DecreaseK SUB kk,kk,8
PBP kk,Loop
POP 2,0
Main GETA t,8F
TRAP 0,Fopen,StdIn
GETA t,9F
TRAP 0,Fread,StdIn
SET $0,N<<3
1H SR $2,$0,3
PUSHJ 1,Maximum
TRAP 0,Halt,0
9H OCTA X0+1<<3,N<<3
8H OCTA 7F,TextRead
7H BYTE "sort.dat",0