diff options
Diffstat (limited to 'v4.0/src/MAPPER/QFILEMOD.ASM')
| -rw-r--r-- | v4.0/src/MAPPER/QFILEMOD.ASM | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/v4.0/src/MAPPER/QFILEMOD.ASM b/v4.0/src/MAPPER/QFILEMOD.ASM new file mode 100644 index 0000000..59fc70c --- /dev/null +++ b/v4.0/src/MAPPER/QFILEMOD.ASM | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | page 80,132 | ||
| 2 | |||
| 3 | title CP/DOS DosQFileMode mapper | ||
| 4 | |||
| 5 | dosxxx segment byte public 'dos' | ||
| 6 | assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing | ||
| 7 | ; | ||
| 8 | ;********************************************************************** | ||
| 9 | ;* | ||
| 10 | ;* MODULE: dosqfilemode Read file attribute | ||
| 11 | ;* | ||
| 12 | ;* FUNCTION: Query file mode | ||
| 13 | ;* | ||
| 14 | ;* CALLING SEQUENCE: | ||
| 15 | ;* | ||
| 16 | ;* push@ asciiz file path name | ||
| 17 | ;* push@ word attribute return area | ||
| 18 | ;* push dword reserved | ||
| 19 | ;* call dosqfilemode | ||
| 20 | ;* | ||
| 21 | ;* MODULES CALLED: PC-DOS Int 21h, ah=43h, change file mode | ||
| 22 | ;* | ||
| 23 | ;********************************************************************* | ||
| 24 | |||
| 25 | public dosqfilemode | ||
| 26 | .sall | ||
| 27 | .xlist | ||
| 28 | include macros.inc | ||
| 29 | .list | ||
| 30 | |||
| 31 | error_code equ 0002h | ||
| 32 | |||
| 33 | str struc | ||
| 34 | old_bp dw ? | ||
| 35 | return dd ? | ||
| 36 | rsrvd dd ? | ||
| 37 | Attrib dd ? ; current attribute pointer | ||
| 38 | Path dd ? ; file path name pointer | ||
| 39 | str ends | ||
| 40 | |||
| 41 | dosqfilemode proc far | ||
| 42 | Enter dosqfilemode ; push registers | ||
| 43 | |||
| 44 | lds dx,[bp].path ; set path name | ||
| 45 | |||
| 46 | mov ax,4300h ; set op code | ||
| 47 | int 21h ; get file mode | ||
| 48 | jc error ; jump if error | ||
| 49 | |||
| 50 | lds si,[bp].attrib ; setup return data area | ||
| 51 | mov word ptr [si],cx ; save attribute there | ||
| 52 | sub ax,ax ; set good return code | ||
| 53 | jmp short exit ; return | ||
| 54 | |||
| 55 | error: mov ax,error_code ; set error code | ||
| 56 | |||
| 57 | exit: mexit ; pop registers | ||
| 58 | ret size str - 6 ; return | ||
| 59 | |||
| 60 | dosqfilemode endp | ||
| 61 | |||
| 62 | dosxxx ends | ||
| 63 | |||
| 64 | end | ||