RATCM.MAC;17/au/-bf=[13,10]RATCM.MAC;1 -57,57,/;DLE001/ .bufo1:: .blkb .vbsiz ; A buffer for the subroutines to use ; It becomes a dummy file header ; sometimes -84,89,/;DLE001/ 10$: MOVB (R3)+,R1 ; R1 = attribute type code BEQ 80$ ; If EQ end of list BGT 110$ ; BRANCH IF WRITE REQUEST, ERROR NEG R1 ; R1=POSITIVE ATTRIBUTE CODE dec r1 ; Make it real offset CMP R1,#.ATMAX ; LEGAL ATTRIBUTE CODE? BHIS 110$ ; BRANCH IF TOO BIG -94,97,/;DLE001/ 30$: CLR R0 ; BISB .atctc(R1),R0 ; R0=MAXIMUM COUNT ALLOWED -104,137,/;DLE001/ CMP R2,R0 ; DESIRED COUNT LEGAL? BHI 110$ ; BRANCH IF NO asl r1 ; Point to flags mov .atctf(r1),r0 ; set flags and offset into r0 bit #at.sub,r0 ; Is this a subroutine call? bne 45$ mov #.bufo1,r0 ; Where to place data push ; Save the used regs call @.atctf(r1) ; Goto routine pop ; Fetch the regs back br 73$ 45$: mov .fcbad,r1 ; preset BIT #AT.FCB,r0 ; DATA IN FCB? BNE 60$ ; BRANCH IF YES mov r4,r1 ; Preset vcb address BIT #AT.VCB,r0 ; Data in VCB? BNE 60$ ; If NE yes mov #.hdbuf,r1 ; Header section? bit #at.hdr,r0 ; header section? bne 60$ MOVB .HDBUF,R1 ; Point to ident offset byte bit #at.idn,r0 ; Ident area? bne 59$ movb .hdbuf+1,r1 ; Point to map offset byte 59$: bic #177400,r1 asl r1 add #.hdbuf,r1 ; Point to retreival pointers bit #at.map,r0 ; Map area? bne 60$ ; We should not get here but just in case ; Leave pointer alone 60$: swab r0 ; Set up offset bic #177400,r0 ADD R1,R0 ; R0 = address of data to move to user 73$: ; R0 = address of input buffer ; R2 = byte counter -143,144,/;DLE001/ 75$: CMP (R3)+,(R3)+ -150,151,/;DLE001/ 80$: TST (SP)+ ; CLEAN OFF MAX ATTRIBUTE COUNT 90$: RETURN -158,,/;DLE001/ .atsu1:: movb .hdbuf+h.prog,(r0)+ ; move data movb .hdbuf+h.proj,(r0)+ .atsu2:: mov .hdbuf+h.fpro,(r0)+ mov .hdbuf+h.ucha,(r0)+ return ; Fetch file name and convert to rad50 .atsu5:: mov r0,-(sp) ; Save for a temp mov r0,r3 ; Set pointer clr (r3)+ ; Make output field a null (blanks) clr (r3)+ clr (r3) cmp -(r3),-(r3) ; push back movb .hdbuf,r0 ; Point to file id section asl r0 add #.hdbuf+i.fnam,r0 ; We have the address in r0 clr r1 ; Stop on period call $cat5b ; convert ascii to rad50 include blanks mov r1,(r3)+ ; Store 1st three cmpb #'.,r2 ; Done? beq 20$ ; Stop scanning clr r1 ; Stop on period call $cat5b mov r1,(r3)+ ; Store 2nd three cmpb #'.,r2 ; Done? beq 20$ ; Stop scanning clr r1 ; Stop on period call $cat5b mov r1,(r3)+ ; Store 3rd three (or 2nd three ) 20$: mov (sp)+,r0 ; Fetch back add #6.,r0 ; Point to file name ext ; .... Fall into next ; Fetch exten and convert to rad50 .atsu6:: mov r0,r3 ; Set output pointer movb .hdbuf,r0 ; Point to file id section asl r0 ; Make into bytes add #.hdbuf+i.fnam,r0 ; We have the address in r0 mov r0,r2 ; Make up overflow pointer add #i.rvno-i.fnam,r2 ; ok, let's look for the period clr r1 ; Preset to empty ext 5$: cmpb #'.,(r0)+ ; Is this it? beq 10$ cmp r0,r2 ; Overflow? blos 5$ add #,r0 ; Point to (r0 is pointing to i.rvno) add #i.fext-i.fnam,r2 ; ...exten buffer 7$: cmp r0,r2 ; Overflow? bhi 20$ cmpb #'.,(r0)+ ; Is this it? bne 7$ 10$: call $cat5b ; r0 points to ext 20$: mov r1,(r3)+ ; Store something for ext mov r3,r0 ; set for next ; .... Fall into next ; Look for revision .atsu7:: mov r0,r3 ; Set pointer movb .hdbuf,r0 ; Point to ident section asl r0 add #.hdbuf+i.fnam,r0 ; We have the address in r0 mov r0,r2 add #,r2 ; Lets look for the semicolon clr r1 ; Preset inc r1 ; ... to a version number of one 5$: cmpb #';,(r0)+ ; Is this it? beq 10$ cmp r0,r2 ; Overflow? blos 5$ add #,r0 ; Point to ( r0 has been bumped to i.rvno) add #,r2 ; ...exten buffer 7$: cmp r0,r2 ; Overflow? bhi 20$ cmpb #';,(r0)+ ; Is this it? bne 7$ 10$: call $cdtb ; r0 points to version number 20$: mov r1,(r3)+ ; Store something for version number return ; Fetch date fields and convert to ascii date .atsue:: mov r0,-(sp) ; Save r0 movb .hdbuf,r1 ; Fetch file id area asl r1 ; Make into words add #.hdbuf+i.crdt,r1 ; Point to creation date in header buf clr r2 ; Do 13 bytes worth call .cdtta ; Make date into ascii string add #13.,(sp) ; Point to next date mov (sp),r0 add #8.,r1 ; Do the revision date call .cdtta add #13.,(sp) ; Point to next output field mov (sp)+,r0 ; Fetch pointer add #8.,r1 ; Do the experation date mov pc,r2 ; Set r2 non zero (the exp date will have ; a zero appended exp = ddmmmyy<0> callr .cdtta ; Convert and return to call ; ; Ok folks a real hack.... make up a dummy file header from ods-2 to ods-1 ; r0 points to where to place the data ( buffer of 512 bytes ) .atsua:: mov r0,-(sp) ; Place address of buffer for later use mov (sp),r1 ; Fetch output buffer address mov #.vbsiz,r2 asr r2 5$: clr (r1)+ ; Clear the whole buffer sob r2,5$ mov #.hdbuf,r1 ; Set pointer to input buffer ; And start (r0 set here but we could mov (sp),r0) tst (r0)+ ; Skip pointer location mov h.fnum(r1),(r0)+ mov h.fseq(r1),(r0)+ mov h.flev(r1),(r0)+ movb h.prog(r1),(r0)+ movb h.proj(r1),(r0)+ mov h.fpro(r1),(r0)+ mov h.fcha(r1),(r0)+ ; ufat mov r1,r2 add #h.ufat,r2 ; Point to ufat area mov #/2,r3 ; Set counter 10$: mov (r2)+,(r0)+ sob r3,10$ ; Make up offset pointer mov r0,r2 sub (sp),r2 ; Subtract start for.... asr r2 ; ... offset calculation movb r2,@(sp) ; Set offset into ident area ; r0 points to output area push ; Save these two call .atsu5 ; Make up file name section pop ; Fetch back add #10.,r0 ; Point to next movb h.idof(r1),r2 ; Make up a new pointer asl r2 add r1,r2 ; Now pointing to ident area mov i.rvno(r2),(r0)+ ; r0 now points to date area in output push call .atsue ; Make up the dates pop add #34.,r0 ; Point ot next area mov r0,r2 sub (sp),r2 asr r2 swab r2 ; @1(sp) is @@sp+1 bis r2,@(sp) ; Make up pointer to map area ; ; Map area mov m.esqn(r1),(r0)+ mov m.efnu(r1),(r0)+ mov m.efsq(r1),(r0)+ clr (r0)+ movb m.use(r1),(r0)+ clrb (r0)+ ; Since the retreival pointers are not much help in ods-2, do ; not move them (yet) ; ; need to calculate a check sum mov (sp)+,r1 ; Clear stack and set for next call .cksum mov r0,(r1) ; Set it the check sum return /