home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pdp11 / k11fix.mac < prev    next >
Text File  |  2020-01-01  |  2KB  |  131 lines

  1.     .title    k11fix    fix attributes so rmscnv and pip can do ansi binaries
  2.     .ident    /T9.0/
  3.  
  4. ;     Write  attribute entries for Kermit-11 tasks and save images
  5. ;    so that (1) F77 will read the files as fixed 512 direct files
  6. ;    and (2)  so RMSCNV and PIP can put them on ANSI tapes intact.
  7. ;    For RSTS/E only.
  8. ;
  9. ;
  10. ;    14-Nov-84  05:23:10  Brian Nelson
  11.  
  12.     .psect
  13.  
  14. list:    .word    10$,20$,30$,40$,50$,60$,70$,80$
  15. 10$:    .asciz    /in:k11.tsk/
  16. 20$:    .asciz    /in:k11nrs.tsk/
  17. 30$:    .asciz    /in:k11rsx.tsk/
  18. 40$:    .asciz    /in:k11pos.tsk/
  19. 50$:    .asciz    /in:k11xm.sav/
  20. 60$:    .asciz    /in:k11rt4.sav/
  21. 70$:    .asciz    /in:k11i31.tsk/
  22. 80$:    .asciz    /in:k11i32.tsk/
  23. msg:    .asciz    / updated/<15><12>
  24.     .even
  25.  
  26.  
  27. st:    mov    #list    ,r4
  28. 10$:    tst    @r4
  29.     beq    100$
  30.     mov    (r4)+    ,r0
  31.     call    print
  32.     call    fix
  33.     tst    r0
  34.     beq    20$
  35.     movb    #errfq    ,firqb+fqfun
  36.     movb    r0    ,firqb+4
  37.     calfip
  38.     clrb    firqb+37
  39.     mov    #firqb+4,r0
  40.     call    print
  41.     br    30$
  42. 20$:    mov    #msg    ,r0
  43.     call    print
  44. 30$:    br    10$
  45. 100$:    .exit
  46.  
  47. fix:    mov    r0    ,r1        ; save address of string
  48. 10$:    tstb    (r0)+            ; find the end of it
  49.     bne    10$            ; not yet
  50.     sub    r1    ,r0        ; get the length
  51.     dec    r0            ; fix it
  52.     mov    #xrb    ,r2        ; point to the xrb
  53.     mov    r0    ,(r2)+        ; length
  54.     mov    r0    ,(r2)+        ; length again
  55.     mov    r1    ,(r2)+        ; address of the string
  56.     clr    (r2)+            ; not used
  57.     clr    (r2)+            ; not used
  58.     clr    (r2)+            ; not used
  59.     clr    (r2)+            ; not used
  60.     call    clrfqb            ; insure no defaults
  61.     .fss                ; parse it
  62.     movb    firqb    ,r0        ; check for errors
  63.     bne    100$            ; oops
  64.     movb    #opnfq    ,firqb+fqfun    ; open it up please
  65.     movb    #2    ,firqb+fqfil    ; channel*2
  66.     calfip                ; do it
  67.     movb    firqb    ,r0        ; success?
  68.     bne    100$            ; no
  69.     mov    firqb+fqsiz,r3        ; save file size
  70.     call    clrfqb            ; write attributes now
  71.     mov    #firqb+fqfun,r0        ; simple to do
  72.     movb    #uu.atr    ,(r0)+        ; write attributes
  73.     incb    (r0)+            ; channel one
  74.     movb    #6    ,(r0)+        ; word count
  75.     mov    #1    ,(r0)+        ; FIXED
  76.     mov    #1000    ,(r0)+        ; 512 byte records
  77.     clr    (r0)+            ;
  78.     mov    r3    ,(r0)+        ; end of file mark
  79.     clr    (r0)+            ;
  80.     mov    r3    ,@r0        ; next free block
  81.     inc    @r0            ;
  82.     .uuo                ; do it
  83.     movb    firqb    ,r0
  84.     bne    100$
  85.     call    clrfqb
  86.     movb    #clsfq    ,firqb+fqfun
  87.     movb    #2    ,firqb+fqfil
  88.     calfip
  89.     clr    r0
  90.     
  91. 100$:    return
  92.  
  93.  
  94.  
  95.     
  96.  
  97. clrfqb:    mov    r0    ,-(sp)
  98.     mov    r1    ,-(sp)
  99.     mov    #40    ,r0
  100.     mov    #firqb    ,r1
  101. 10$:    clrb    (r1)+
  102.     sob    r0    ,10$
  103.     mov    (sp)+    ,r1
  104.     mov    (sp)+    ,r0
  105.     return
  106.  
  107. print:    mov    r0    ,-(sp)
  108.     mov    r1    ,-(sp)
  109.     mov    r2    ,-(sp)
  110.     mov    r0    ,r1
  111. 10$:    tstb    (r0)+
  112.     bne    10$
  113.     sub    r1    ,r0
  114.     dec    r0
  115.     mov    #xrb    ,r2
  116.     mov    r0    ,(r2)+
  117.     mov    r0    ,(r2)+
  118.     mov    r1    ,(r2)+
  119.     clr    (r2)+
  120.     clr    (r2)+
  121.     clr    (r2)+
  122.     clr    (r2)+
  123.     .write
  124.     mov    (sp)+    ,r2
  125.     mov    (sp)+    ,r1
  126.     mov    (sp)+    ,r0
  127.     return
  128.  
  129.  
  130.     .end    st
  131.