Subversion Repositories SvarDOS

Rev

Rev 1154 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1154 Rev 1155
Line 13... Line 13...
13
;
13
;
14
 
14
 
15
CPU 8086
15
CPU 8086
16
org 0x100
16
org 0x100
17
 
17
 
-
 
18
; print whatever drive/filename is set at 0x5C (1st unopened FCB in the PSP)
-
 
19
mov dx, PARAM
-
 
20
mov ah, 0x09
-
 
21
int 0x21
-
 
22
 
-
 
23
mov bx, 0x5C
-
 
24
call PRINTDTA
-
 
25
 
18
; FindFirst_FCB applied to PSP:5C (1st unopened FCB)
26
; FindFirst_FCB applied to PSP:5C (1st unopened FCB)
19
mov dx, 0x5C
27
mov dx, 0x5C
20
mov ah, 0x11
28
mov ah, 0x11
21
int 0x21
29
int 0x21
22
 
30
 
Line 24... Line 32...
24
jne GAMEOVER
32
jne GAMEOVER
25
 
33
 
26
NEXT:
34
NEXT:
27
 
35
 
28
; print filename in DTA
36
; print filename in DTA
-
 
37
mov bx, 0x80
29
call PRINTDTA
38
call PRINTDTA
30
 
39
 
31
; FindNext_FCB on PSP until nothing left
40
; FindNext_FCB on PSP until nothing left
32
mov ah, 0x12
41
mov ah, 0x12
33
mov dx, 0x5C
42
mov dx, 0x5C
Line 37... Line 46...
37
 
46
 
38
GAMEOVER:
47
GAMEOVER:
39
 
48
 
40
int 0x20
49
int 0x20
41
 
50
 
-
 
51
PARAM:
-
 
52
db "PARAMETER = $";
42
 
53
 
43
 
54
 
44
; ****** print the filename present in the DTA (DTA is assumed at 0x80) ******
55
; ****** print the filename present in the DTA (DTA is at [BX]) ******
45
PRINTDTA:
56
PRINTDTA:
46
; print drive in the DTA
57
; print drive in the DTA
47
mov ah, 0x02
58
mov ah, 0x02
48
mov dl, [0x80]
59
mov dl, [bx]
49
add dl, 'A'
60
add dl, '@'
50
int 0x21
61
int 0x21
51
mov dl, ':'
62
mov dl, ':'
52
int 0x21
63
int 0x21
53
; print filename/extension (in FCB format)
64
; print filename/extension (in FCB format)
54
mov ah, 0x40    ; write to file
65
mov ah, 0x40    ; write to file
55
mov bx, 1       ; output to stdout
-
 
56
mov cx, 11      ; 11 bytes (8+3)
66
mov cx, 11      ; 11 bytes (8+3)
57
mov dx, 0x81    ; filename field at the default DTA location
67
mov dx, bx      ; filename field at the default DTA location
-
 
68
inc dx
-
 
69
mov bx, 1       ; output to stdout
58
int 0x21
70
int 0x21
59
; print a trailing CR/LF
71
; print a trailing CR/LF
60
mov ah, 0x02    ; display character in DL
72
mov ah, 0x02    ; display character in DL
61
mov dl, 0x0D    ; CR
73
mov dl, 0x0D    ; CR
62
int 0x21
74
int 0x21