changeset 2440:d5ba9175a498

more RFM:
author aaronwolfe
date Thu, 25 Feb 2010 02:42:06 +0000
parents eabc21a96aa3
children d701ee4e0732
files level1/modules/rfm.asm level1/modules/rfmdrv.asm level1/modules/y0_rfm.asm
diffstat 3 files changed, 66 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/level1/modules/rfm.asm	Thu Feb 25 00:19:21 2010 +0000
+++ b/level1/modules/rfm.asm	Thu Feb 25 02:42:06 2010 +0000
@@ -21,7 +21,8 @@
 
          mod   eom,RFMName,tylg,atrv,RFMEnt,size
 
-pathtmp	 rmb	256		         
+*         org V.RFM
+pathtmp	 equ	128		         
 size	 equ	*         
          
 RFMName  fcs   /RFM/
@@ -51,9 +52,16 @@
          lbra  setstt       Set Status
          lbra  close        Close path
 
-create	lda		#DW.create
-		lbra	sendit
-
+create	pshs u
+				
+		* put path # on stack
+		lda		,y
+		pshs	a
+		
+		* put rfm op and DW op on stack
+		ldb		#DW.create
+		bra		create1
+		
 open	pshs u
 				
 		* put path # on stack
@@ -62,7 +70,7 @@
 		
 		* put rfm op and DW op on stack
 		ldb		#DW.open
-		lda		#OP_VFM
+create1	lda		#OP_VFM
 		pshs	d
 		
 		leax      ,s                  ; point X to stack 
@@ -85,25 +93,29 @@
        
         ldx		,s		; orig U is on stack
         ldx		R$X,x	; should be X from caller
-		leay		pathtmp,pcr
-		
+        	
 		clra	
 		pshs 	a
 		
+		leas	-pathtmp,s
+		leay	,s
+		
 open1  os9	f$ldabx
 		sta		,y+
         leax	1,x
-        inc		,s
+        inc		pathtmp,s
         cmpa	#$0D
         bne		open1
 
         * send to server
         clra 
-        ldb		,s		; leave a byte on stack for response
+        ldb		pathtmp,s		; leave a byte on stack for response
         tfr		d,y
-        leax 	pathtmp,pcr	
+        leax 	,s	
         jsr		6,u
         
+        leas	pathtmp,s
+        
 		* read response from server -> B
         leax	,s
         ldy		#1
@@ -166,29 +178,40 @@
         jsr		3,u
         
         ldb		,s
-       * bne		readln1
+       	beq		readln1		; 0 bytes = EOF
         
-        * eof
-        leas	1,s
-        ldb		#211
-        orcc	#1
+       	* read the data from server if > 0
+       	leas	-b,s		; doesnt work
+       	pshs	b
+       	leax	1,s
+       	clra
+       	tfr		d,y
+       	jsr		6,u
+       	
+       	puls 	a
+       	
+		ldx   <D.Proc   	get curr proc desc
+        ldb   P$Task,x  	get task #
+       	
+        inca	
+       	ldx		a,s		;pointer to caller's stack is on our stack, behind the data and one byte
+       	deca
+       	ldx		R$X,x	; should be X from caller
+       	
+       	* ok.. now data is on stack, data size in A, caller's task in B, addr in caller to put it at is in X 
+       	* get it into calling proc with F$STABX?
+       	
+       	
+       	
+       	
+       clrb
+       bra		readln2
+       	
+readln1	orcc	#1
+       	ldb		#211
+readln2	leas	1,s
         puls	u
         rts
-        
-        * read B chars into mem at addr in caller's X
-        * first into our buffer INCOMPLETE/FUBAR
-readln1	puls 	b
-		leax	pathtmp,pcr
-		clra
-		tfr		d,y
-		jsr		3,u
-		
-		puls	u		; done with dwsub
-		
-		
-		
-		clrb
-		rts
 
         
 writln	lda		#DW.writln
@@ -218,9 +241,17 @@
         endc      
          
         jsr		6,u
-        leas	3,s		;clean stack
+        leas	2,s		;clean stack (leave 1 byte)
 		
-		clrb
+        * read server response
+        leax	,s
+        ldy		#1
+        jsr		3,u
+        
+        ldb		,s ; server sends result code
+        beq		close1
+        orcc	#1	; set error flag if != 0
+close1	leas	1,s
 		puls	u
 		rts
 		
--- a/level1/modules/rfmdrv.asm	Thu Feb 25 00:19:21 2010 +0000
+++ b/level1/modules/rfmdrv.asm	Thu Feb 25 02:42:06 2010 +0000
@@ -20,7 +20,8 @@
 wtf  rmb   1
 size     equ   .
 
- 		fcb   READ.+WRITE.
+ 		 fcb   DIR.+SHARE.+PEXEC.+PWRIT.+PREAD.+EXEC.+UPDAT.
+
 
 name     fcs   /rfmdrv/
          fcb   edition
--- a/level1/modules/y0_rfm.asm	Thu Feb 25 00:19:21 2010 +0000
+++ b/level1/modules/y0_rfm.asm	Thu Feb 25 02:42:06 2010 +0000
@@ -16,7 +16,7 @@
 
          mod   eom,name,tylg,atrv,mgrnam,drvnam
 
-         fcb   READ.+WRITE. mode byte
+         fcb   DIR.!SHARE.!PEXEC.!PWRIT.!PREAD.!EXEC.!UPDAT. mode byte
          fcb   $00        extended controller address
          fdb   $0000      physical controller address
          fcb   initsize-*-1 initilization table size