# HG changeset patch # User boisy # Date 1267225198 0 # Node ID a4ac68ad79e49e7df2e9943519e8b2680ce3cd67 # Parent 1e9288481779b41302381172f4df9bc257eac588 Added PrsNam support... crashes at the moment diff -r 1e9288481779 -r a4ac68ad79e4 level1/modules/rfm.asm --- a/level1/modules/rfm.asm Fri Feb 26 22:17:24 2010 +0000 +++ b/level1/modules/rfm.asm Fri Feb 26 22:59:58 2010 +0000 @@ -59,19 +59,45 @@ open ldb #DW.open create1 ldx PD.DEV,y ; get ptr to our static storage - pshs b,x,y,u ; save all on stack - + pshs x,y,u ; save all on stack + stb V.DWCMD,x + * TODO lets not create multiple buffers when multiple open/create on same path * get system mem ldd #256 os9 F$SRqMem ; ask for D bytes (# bytes server said is coming) - puls a - bcs open2 + lbcs open2 stu V.BUF,x -* put path # on stack +* use PrsNam to validate pathlist and count length + ldu 4,s ; get pointer to caller's registers + ldy R$X,u + sty V.PATHNAME,x + tfr y,x +prsloop os9 F$PrsNam + bcs open2 + tfr y,x + anda #$7F + cmpa #PENTIR + bne chkdelim + ldb #E$BPNam + bra openerr +chkdelim cmpa #PDELIM + beq prsloop +* at this point X points to the character AFTER the last character in the name +* update callers R$X + ldu 4,s ; get caller's registers + stx R$X,u + +* compute the length of the pathname and save it + tfr x,d + ldx ,s ; get the device memory pointer + subd V.PATHNAME,x + std V.PATHNAMELEN,x ; save the length + +* put command byte & path # on stack + lda V.DWCMD,x ldb PD.PD,y - stb V.PATHNUM,x pshs cc pshs d ; p# PD.DEV PD Regs @@ -93,52 +119,52 @@ leas 3,s ;clean stack PD.DEV PD Regs * now send path string +* move from caller to our mem -* copy path string - - clr ,-s ; set size ctr to 0 + ldx D.DWSubAddr + endc jsr 6,u * read response from server -> B + clr ,-s leax ,s ldy #1 jsr 3,u * pull server's response into B puls b ; PD.DEV PD Regs - puls cc +moverr puls cc tstb beq open2 - coma ; set error +openerr coma ; set error open2 leas 6,s ; clean stack rts @@ -167,7 +193,6 @@ * put path # on stack lda PD.PD,y - sta V.PATHNUM,x pshs cc pshs a ; p# PD.DEV PD Regs @@ -240,7 +265,8 @@ ldx 4,s ldu R$X,x ; U = caller's X = dest ptr - + sty R$Y,x + lda