home *** CD-ROM | disk | FTP | other *** search
- ;**************************************************************** *
- ;* * *
- ;* Unterprogramm f}r OPEN, CREATE und KILL * *
- ;* * *
- ;**************************************************************** *
-
- .z80 ;
- entry _setfcb ;
-
- ascii_fcb: call _xfcb## ; mu~ erst umgewandelt werden!
- jr count_wildcard ;
-
- file_open: ld hl,errmsg ;
- jp _exit## ;
- dseg ;
- errmsg: db 'MACLIB Err: File open!',0
- cseg ;
-
- _setfcb: ; HL enth{lt Dateinamen in ASCII
- ; oder in vorgefertigter Form,
- ; DE ist Adresse des FCB
- ld a,(de) ;
- rrca ;
- jr c,file_open ;
- inc de ;
- push de ; FCB Beginn
- ld a,(hl) ; Drive-Field
- cp 16+1 ;
- jr nc,ascii_fcb ;
- ld bc,12 ; Dateiname vorgefertigt, mache nur LDIR
- ldir ;
- count_wildcard: pop hl ; nochmal FCB Adresse
- ld bc,11*256 ; z{hle Anzahl der '?' im FCB
- ld a,'?' ;
- count_wcloop: inc hl ;
- cp (hl) ; ist es Fragezeichen?
- jr nz,test_next ;
- inc c ; Z{hler erh|hen
- test_next: djnz count_wcloop ; next one
- xor a ;
- ld b,24 ; restliche Zeichen im FCB
- zero_fcb: inc hl ;
- ld (hl),a ;
- djnz zero_fcb ;
- or c ; Anzahl Wildcard
- ret ; ZERO-Flag richtig setzen
- end ;