Code: Select all
dseg segment
;------- definitions -------
main_lftFiles_def struct
Result sbyte
Pattern byte[]
FileList byte[][]
main_lftFiles_def ends
DFL_lftFiles_def struct
Result sbyte
Pattern byte[]
FileList byte[][]
DFL_lftFiles_def ends
SF_lftFiles_def struct
Result sbyte
Pattern byte[]
FileList byte[][]
SF_lftFiles_def ends
Location_def struct
X sword
Y sword
Location_def ends
PointOutArgs_def struct
Result sbyte
Location Location_def
Options dword
PointOutArgs_def ends
Location_def struct
X sword
Y sword
Location_def ends
TextOutArgs_def struct
Result sbyte
Location Location_def
Text byte[]
Options dword
TextOutArgs_def ends
;------- declarations -------
DU0SF dword
D0strlen_inline_IS sdword
sstack_001DM sdword
D0DM sdword
D0IS sdword
D0SF sdword
sstack_001SF sdword
sstack_002SF sdword
IS_len dword
sstack_002DM sdword
sstack_002IS sdword
usstack_001IS dword
TextOutMutex mutex
DU0DFL dword
IS_chSpaces_len word
DFL_FileCount word
SF_FileCount word
IS_return byte
SF_return byte
initialize_global_data_return byte
DM_return byte
DFL_return byte
main_lftFiles main_lftFiles_def
DFL_lftFiles DFL_lftFiles_def
SF_lftFiles SF_lftFiles_def
PointOutArgs PointOutArgs_def
TextOutArgs TextOutArgs_def
DFL_fl byte[][]
strbufIS byte[]
ArrHelperIS_2 byte[]
strbufmain byte[]
strretvalDFL byte[]
strbufDM byte[]
strbufDFL byte[]
IS_b byte[] 0x0
strbufBATS_inline_IS byte[]
strretvalSF byte[]
ArrHelperIS_0 byte[]
ArrHelperIS_1 byte[]
IS_a byte[] 0x0
BATS_data_inline_IS byte[]
DM_title byte[] 0x0
DM_list byte[][]
IS_chSpaces sbyte[]
strbufSF byte[]
strlen_str_inline_IS byte[] 0x0
dseg ends
;------- code -------
thread main
subcall initialize_global_data, initialize_global_data_return
strcat strbufmain, '*.*'
mov main_lftFiles.Pattern, strbufmain
#pragma macro 4
syscall 47, main_lftFiles
mov SF_lftFiles, main_lftFiles
subcall SF, SF_return
mov main_lftFiles, SF_lftFiles
wait 5000
exit -1, -1
endt
;------------------------
subroutine IS
mov usstack_001IS, IS_len
strcat strbufIS, IS_a
mov strlen_str_inline_IS, strbufIS
arrsize D0strlen_inline_IS, strlen_str_inline_IS
sub sstack_002IS, D0strlen_inline_IS, 1
strcat strbufIS, IS_b
mov strlen_str_inline_IS, strbufIS
arrsize D0strlen_inline_IS, strlen_str_inline_IS
sub D0IS, D0strlen_inline_IS, 1
add D0IS, sstack_002IS, D0IS
sub IS_chSpaces_len, usstack_001IS, D0IS
arrinit IS_chSpaces, 32, IS_chSpaces_len
mov ArrHelperIS_0, IS_a
mov BATS_data_inline_IS, IS_chSpaces
arrtostr strbufBATS_inline_IS, BATS_data_inline_IS
mov ArrHelperIS_1, strbufBATS_inline_IS
strcat strbufIS, IS_b
mov ArrHelperIS_2, strbufIS
strcat strbufIS, ArrHelperIS_1, ArrHelperIS_2
mov ArrHelperIS_1, strbufIS
strcat strbufIS, ArrHelperIS_0, ArrHelperIS_1
subret IS_return
subret IS_return
ends
;------------------------
subroutine DM
set sstack_001DM, 0
set sstack_002DM, 56
strcat strbufDM, DM_title
set D0DM, 4
acquire TextOutMutex
mov TextOutArgs.Location.X, sstack_001DM
mov TextOutArgs.Location.Y, sstack_002DM
mov TextOutArgs.Options, D0DM
mov TextOutArgs.Text, strbufDM
syscall 13, TextOutArgs
mov D0DM, TextOutArgs.Result
release TextOutMutex
subret DM_return
ends
;------------------------
subroutine DFL
arrsize DFL_FileCount, DFL_lftFiles.FileList
arrbuild DFL_fl, DFL_lftFiles.FileList
strcat strbufDFL, 'File Count:'
mov IS_a, strbufDFL
mov DU0DFL, DFL_FileCount
numtostr strretvalDFL, DU0DFL
strcat strbufDFL, strretvalDFL
mov IS_b, strbufDFL
set IS_len, 16
subcall IS, IS_return
mov strretvalDFL, strbufIS
strcat strbufDFL, strretvalDFL
mov DM_title, strbufDFL
mov DM_list, DFL_fl
subcall DM, DM_return
mov DFL_fl, DM_list
subret DFL_return
ends
;------------------------
subroutine SF
arrsize D0SF, SF_lftFiles.FileList
mov SF_FileCount, DU0SF
#pragma macro 6
mov PointOutArgs.Location.X, 200
mov PointOutArgs.Location.Y, 200
mov PointOutArgs.Options, 1
syscall 14, PointOutArgs
mov DFL_lftFiles, SF_lftFiles
subcall DFL, DFL_return
mov SF_lftFiles, DFL_lftFiles
set sstack_001SF, 0
set sstack_002SF, 0
strcat strbufSF, 'File Count:'
mov IS_a, strbufSF
mov DU0SF, SF_FileCount
numtostr strretvalSF, DU0SF
strcat strbufSF, strretvalSF
mov IS_b, strbufSF
set IS_len, 16
subcall IS, IS_return
mov strretvalSF, strbufIS
strcat strbufSF, strretvalSF
acquire TextOutMutex
mov TextOutArgs.Location.X, sstack_001SF
mov TextOutArgs.Location.Y, sstack_002SF
set TextOutArgs.Options, 0
mov TextOutArgs.Text, strbufSF
syscall 13, TextOutArgs
mov D0SF, TextOutArgs.Result
release TextOutMutex
subret SF_return
ends
;------------------------
subroutine initialize_global_data
subret initialize_global_data_return
ends
;------------------------