nolist ;iy+00 bis iy+02 vektor fuer sprungleiste ;write direct -1,3 write"fatdos.rom" org &c000:limit &ffff cas_catalog equ &bc9b cas_in_close equ &bc7a cas_in_open equ &bc77 cas_out_close equ &bc8f cas_out_open equ &bc8c hi_kl_curr_selection equ &b912 txt_output equ &bb5a db 1 ;hintergrund-rom db 0,0,0 ;version defw cmdtbl ;zeiger auf befehlstabelle jp init ;sprungleiste jp fat jp fatin ;|fat.in jp fatout jp niyet cmdtbl db "FAT RO","M"+&80 db "FA","T"+&80 db "FAT.I","N"+&80 db "FAT.OU","T"+&80 db "NIYE","T"+&80 db 0 init push bc:push hl ld hl,imeld:call prstr ;initialisierungsmeldung ausgeben pop hl ld bc,-16:add hl,bc ;16 byte arbeitsspeicher fuer das rom reservieren push hl:pop iy:inc iy ;iy zeigt auf dynamisch zugewiesenes ram ld a,jvec and &ff:ld (iy+0),a ;far adress fuer die behandlungsroutine der betriebssystemaufrufe anlegen ld a,jvec/&100:ld (iy+1),a ; / call hi_kl_curr_selection ; / ld (iy+2),a ;/ pop bc scf ret jvec di ;interrupts duerfen nicht dazwischenfunken ex af,af':exx ;auf zweiten registersatz umschalten ld a,c ;C wird in A gesichert pop de ;Ruecksprungadresse nach holen DE pop bc ;2. Wert vom Stack holen pop hl ;3. Wert vom Stack holen ex (sp),hl ;und mit oberstem Wert auf dem Stack vertauschen push bc ;2. Wert auf Stack zuruecklegen push de ;Ruecksprungadresse auf Stack zuruecklegen ld c,a ;BC wiederherstellen ld b,&7f ;/ ld de,fatjmps-&bc77-3:add hl,de push hl exx:ex af,af' ei ;interrupts wieder zulassen jp &be7f ;ein ret wird angesprungen fatjmps jp niyet ;in open jp niyet ;in close jp niyet ;in abandon jp niyet ;in char jp niyet ;in direct jp niyet ;return jp niyet ;test eof jp niyet ;out open jp niyet ;out close jp niyet ;out abandon jp niyet ;out char jp niyet ;out direct jp niyet ;catalog niyet push af:push bc:push de:push hl:push ix:push iy ld hl,tniyet:call prstr ;"Not implementet yet" ausgeben pop iy:pop ix:pop hl:pop de:pop bc:pop af ret prstr ld b,(hl) ;laenge des strings holen prsloop inc hl ;hl zeigt auf string ld a,(hl):call txt_output ;zeichen ausgeben djnz prsloop ;naechster durchlauf ret ;string ist fertig ausgegeben fat call fatin ;sprungleiste fuer lese- jr fatout ;und schreiboperationen patchen fatin ld hl,cas_in_open:ld a,&df:ld (hl),a ;byte fuer rst3 an vector cas_in_open schreiben inc hl:db &fd:ld a,l:ld (hl),a ;lowerbyte schreiben inc hl:db &fd:ld a,h:ld (hl),a ;upperbyte schreiben ld hl,cas_in_open:ld de,cas_in_close:ld bc,6*3:ldir ;sprungliste fuer leseoperationen patchen ld de,cas_catalog:ldi:ldi:ldi ;/ ret fatout ld hl,cas_out_open:ld a,&df:ld (hl),a ;byte fuer call an vector cas_out_open schreiben inc hl:db &fd:ld a,l:ld (hl),a ;lowerbyte schreiben inc hl:db &fd:ld a,h:ld (hl),a ;upperbyte schreiben ld hl,cas_out_open:ld de,cas_out_close:ld bc,4*3:ldir ;sprungliste fuer schreiboperationen patchen ret tniyet db imeld-tniyet-1,"Not implemented yet!",10,13 imeld db eott-imeld-1," FAT DOS 0.00alpha",10,10,13 eott list dump