comparison level1/cmds/dirsort.asm @ 1955:b377521221d9

Update dirsort by Robert Gault
author boisy
date Tue, 20 Dec 2005 19:47:47 +0000
parents e5ad0755bf40
children 6b282e7c880f
comparison
equal deleted inserted replaced
1954:e5ad0755bf40 1955:b377521221d9
16 * Very fast and fairly simple 16 * Very fast and fairly simple
17 17
18 NAM dirsort 18 NAM dirsort
19 * This ensures the assembler knows predefined OS-9 terms 19 * This ensures the assembler knows predefined OS-9 terms
20 IFP1 20 IFP1
21 USE defsfile 21 USE /dd/defs/defsfile
22 ENDC 22 ENDC
23
24 * If you want built-in help change the next line.
25 HELP SET FALSE
23 26
24 TyLg SET Prgrm+Objct program object code 27 TyLg SET Prgrm+Objct program object code
25 * Re-entrant means multiple users possible 28 * Re-entrant means multiple users possible
26 AtRev SET ReEnt+Rev re-entrant, revision 1 29 AtRev SET ReEnt+Rev re-entrant, revision 1
27 Rev SET 1 30 Rev SET 1
87 beq l1 90 beq l1
88 cmpa #C$CR if only spaces, same as noprm 91 cmpa #C$CR if only spaces, same as noprm
89 bne a1 92 bne a1
90 noprm leax default,pcr point to default directory, dot 93 noprm leax default,pcr point to default directory, dot
91 bra a9 94 bra a9
95 IFNE HELP
92 a1 cmpa #'? if "?" then show syntax 96 a1 cmpa #'? if "?" then show syntax
93 lbeq syntax 97 lbeq syntax
94 cmpa #'- if attempt at options, syntax 98 cmpa #'- if attempt at options, syntax
95 lbeq syntax 99 lbeq syntax
96 leax -1,x backstep to first character of directory 100 leax -1,x
101 ELSE
102 a1 leax -1,x backstep to first character of directory
103 ENDC
97 a9 lda #%11000011 directory, single user access, update 104 a9 lda #%11000011 directory, single user access, update
98 os9 I$Open attempt to open a path to the directory 105 os9 I$Open attempt to open a path to the directory
99 lbcs error 106 lbcs error
100 sta <path save the path # 107 sta <path save the path #
101 ldb #SS.Size get the size of the directory 108 ldb #SS.Size get the size of the directory
344 huh EQU * 351 huh EQU *
345 FCC /Get real! You can't sort less than 2 items./ 352 FCC /Get real! You can't sort less than 2 items./
346 FCB C$CR,C$LF 353 FCB C$CR,C$LF
347 endhuh EQU * 354 endhuh EQU *
348 355
356 IFNE HELP
349 syntax leax usage,pcr 357 syntax leax usage,pcr
350 ldy #enduse-usage 358 ldy #enduse-usage
351 clr ,-s 359 clr ,-s
352 lbra write 360 lbra write
353 usage FCC /USAGE: dirsort will sort any directory. If no directory/ 361 usage FCC /USAGE: dirsort will sort any directory. If no directory/
357 FCC /EX: dirsort dirsort . dirsort ../ 365 FCC /EX: dirsort dirsort . dirsort ../
358 FCB C$CR,C$LF 366 FCB C$CR,C$LF
359 FCC " dirsort /dd/cmds" 367 FCC " dirsort /dd/cmds"
360 FCB C$CR,C$LF 368 FCB C$CR,C$LF
361 enduse EQU * 369 enduse EQU *
370 ENDC
362 371
363 EMOD 372 EMOD
364 Eom EQU * 373 Eom EQU *
374 END