home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / test / pdp11 / krtcvt.mac < prev    next >
Text File  |  1996-10-17  |  16KB  |  484 lines

  1.     .title    KRTCVT    File name and misc data conversions
  2.     .ident    "V04.64"
  3.  
  4. ; /E64/    14-Apr-96  John Santos
  5. ;    Restore RSTS/E filename behaviour:
  6. ;    Add RSTS binary files to list.
  7.  
  8. ; /63/    10-Feb-96 Billy Youdelman
  9. ;
  10. ;    fixfil now fixes unix leading dot ".file" names, also ".x.", etc.
  11. ;    cleaned up chkext
  12. ;    move unfmts to KRTSUB so KRTMDM can use this overlay ...
  13.  
  14. ; /62/    27-Jul-93  Billy Youdelman  V03.62
  15. ;
  16. ;    increase size of fixfil stack buffer to SVID limit
  17.  
  18. ; /BBS/     1-Dec-91  Billy Youdelman  V03.61
  19. ;
  20. ;    added useful RT-11/TSX+ binary file types
  21. ;    modified chkext to handle file types of less than 3 chars
  22. ;    fixfil - parse a device name in filespec, fixed termination bug
  23. ;    namcvt now catches unix "/" and pc "\" directory delimiters
  24. ;    namcvt fixed to not output a "." on a null input file name
  25.  
  26. ;    Copyright 1984 Change Software, Inc.
  27. ;
  28. ;    20-Mar-84  11:31:06 Brian Nelson
  29. ;
  30. ;     Attempt to parse filespecifications that may include DECNET
  31. ;    remote node name and  directories  in  a  manner  compatible
  32. ;    with RSTS, RSX and RT-11.
  33. ;
  34. ;     This was  first  implemented using the host executives file
  35. ;    name parsing services, ie for RSTS using the .FSS  directive
  36. ;    and   for   RSX   using   CSI   and   .PARSE   to   get  the
  37. ;    filespecification converted into rad50 and  then  converting
  38. ;    back  to  ascii.  The  problem with doing it that way, apart
  39. ;    from being a hack, is that we could not process DECNET  node
  40. ;    file  specifications  as the format of remote file names can
  41. ;    never be expected to be compatible  with  the  host  system.
  42. ;    Bob  Denny  wrote  a  new  one  for  RSX  which avoided this
  43. ;    problem,  and  this  version  should  work  on   all  PDP-11
  44. ;    operating systems.
  45. ;
  46. ;     This  is implemented using a  transition state table driver
  47. ;    thus allowing simple modification to accommodate the various
  48. ;    types of node file names that may come up in the future.
  49. ;
  50. ;     For the time being this routine will be placed in the over-
  51. ;    lay region  ERRDVR, since  as of now it is  only called from
  52. ;    KRTPAK and then only once for  each file send  to the remote
  53. ;    system or micro.
  54.  
  55.  
  56.     .include "IN:KRTMAC.MAC"
  57.     .iif ndf  KRTINC  .error    <; .include for IN:KRTMAC.MAC failed>
  58.  
  59.  
  60.     .macro    chtype    ch ,val        ; /62/ work around "n/df" hosing .LST
  61.     .if nb    ch
  62.     . = chtype+ch            ; put in the buffer, according to its
  63.     .byte    val            ; ascii value as an offset into it
  64.     .iff
  65.     . = chtype+128.            ; /63/ if no args, restore pc
  66.     .endc
  67.     .endm    chtype
  68.  
  69.  
  70.     .sbttl    Local data        ; /63/ consolidate here..
  71.  
  72.     .psect    $rwdata    ,rw,d,lcl,rel,con
  73. chkbuf:    .byte    0 ,0 ,0 ,0 ,0 ,0    ; /BBS/ buff to pad extents <3 chars
  74.  
  75.     .psect    $pdata
  76. defchr:    .byte    'X&137            ; replace any bad name char with this
  77. .if df    RT11                ; /E64/
  78. okchr:    .asciz    "0123456789.:ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; /BBS/ allow device
  79. .endc    ;RT11                ; /E64/
  80. .if df    RSTS                ; /E64/
  81. okchr:    .asciz    "[],0123456789.:ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  82.                     ; /E64/ allow device in file spec
  83. .endc    ;RSTS                ; /E64/
  84.     .even                ; /E64/ just in case
  85.  
  86.     .sbttl    BINARY-TYPES default list
  87.     .dsabl    lc            ; binl data MUST be UPPER case
  88.  
  89. ; /BBS/ space-pad to four bytes if file type is less than four bytes..
  90.  
  91. binl:    .ascii    ".BAC"            ; compiled BASIC files
  92.     .ascii    ".BAX"            ; /BBS/ double precision .BAC files
  93.     .ascii    ".BIN"            ; XXDP
  94.     .ascii    ".BOT"            ; /BBS/ RT-11 boot files
  95.     .ascii    ".BUP"            ; /62/ backup files
  96.     .ascii    ".CAL"            ; /62/ spreadsheet files
  97.     .ascii    ".CRF"            ; link cross reference files
  98.     .ascii    ".DEV"            ; /BBS/ old logical disk file
  99.     .ascii    ".DSK"            ; /BBS/ logical disk file
  100.     .ascii    ".EXE"            ; executable image only, no data
  101. .if df    RSTS                ; /E64/
  102.     .ascii    ".HLB"            ; /E64/ help libs ala VMS style?
  103. .endc    ;RSTS                ; /E64/
  104.     .ascii    ".LDA"            ; /62/ absolute load address images
  105. .if df    RSTS                ; /E64/
  106.     .ascii    ".LIB"            ; /E64/ RSTS/E reslibs
  107. .endc    ;RSTS                ; /E64/
  108.     .ascii    ".MLB"            ; macro libraries
  109.     .ascii    ".OBJ"            ; MACRO output files
  110. .if df    RSTS                ; /E64/
  111.     .ascii    ".OLB"            ; /E64/ rsx/ias/rsts object libraries
  112. .endc    ;RSTS                ; /E64/
  113.     .ascii    ".REL"            ; /BBS/ RT-11 relocatable programs
  114.     .ascii    ".RTS"            ; TSX+ run time systems
  115.     .ascii    ".SAV"            ; RT-11 saved images
  116.     .ascii    ".SML"            ; system macro libs
  117.     .ascii    ".STB"            ; LINK symbol tables
  118.     .ascii    ".SYS"            ; RT-11 monitors, drivers
  119. .if df    RSTS                ; /E64/
  120.     .ascii    ".TSD"            ; /E64/ 'time shared dibol' for rt11
  121.     .ascii    ".TSK"            ; /E64/ rsx/ias/rsts tasks
  122. .endc    ;RSTS                ; /E64/
  123.     .ascii    ".TSX"            ; /BBS/ TSX+ system files
  124. .if df    RSTS                ; /E64/
  125.     .ascii    ".ULB"            ; /E64/ rsts/rsx universal libs
  126. .endc    ;RSTS                ; /E64/
  127.     .byte    0            ; /BBS/ end of it all
  128.     .even
  129.     .enabl    lc            ; /BBS/ restore
  130.  
  131.  
  132.     .sbttl    Generate character class table for file name state parsing
  133.  
  134. ;      character    class      operation    /63/ commented for clarity..
  135. ;      ---------    -----      ---------  
  136. ;         other     0      ignore, skip past adding nothing to output
  137. ;          nul     1      input string termination chars, must exit
  138. ;         < ( [     2      start of a dircetory, ppn or uic
  139. ;         > ) ]     3      end of a dircetory, ppn or uic
  140. ;         : / \     4      end of a device, directory or node
  141. ;          dot     5      part of a directory or file name
  142. ;         comma     6      part of a ppn or uic
  143. ;    alpha-numeric     7      any char that's ok in directory or file name
  144.  
  145. chtype:    .rept    128.        ; doing ascii 0. through 127.
  146.     .byte         0    ; init everything to being ignored
  147.     .endr
  148.  
  149.     chtype     0    ,1    ; exit on null
  150.     chtype    lf    ,1    ; /62/ exit on a line feed
  151.     chtype    cr    ,1    ; exit on <cr>
  152.     chtype    '(    ,2    ; start of a rsts style ppn
  153.     chtype    ')    ,3    ; end of a ppn
  154.     chtype    comma    ,6    ; part of a uic or ppn
  155.     chtype    dot    ,5    ; part of a file name or directory
  156.     chtype    '/    ,4    ; /BBS/ end of a unix directory
  157.      $ch =    '0        ; /62/ digits are ok most anywhere
  158.      .rept    10.
  159.      chtype    $ch    ,7
  160.      $ch =    $ch+1        ; do 0 through 9
  161.      .endr
  162.     chtype    '<    ,2    ; start of a TOPS-20 directory
  163.     chtype    ':    ,4    ; end of a device or node
  164.     chtype    scolon    ,1    ; exit on ";" version delimiter
  165.     chtype    '>    ,3    ; end of a TOPS-20 directory
  166.      $ch =    'A&137        ; letters are also ok most anywhere
  167.      .rept    32
  168.      chtype    $ch    ,7
  169.      $ch =    $ch+1        ; do A through Z
  170.      .endr
  171.     chtype    '[    ,2    ; start of a directory or uic
  172.     chtype    '\    ,4    ; /BBS/ end of a pc directory
  173.     chtype    ']    ,3    ; end of a directory
  174.     chtype            ; /63/ end of this list
  175.      $ch =    'a!40        ; don't forget lower case letters
  176.      .rept    32
  177.      chtype    $ch    ,7
  178.      $ch =    $ch+1        ; do a through z
  179.      .endr
  180.     chtype            ; /63/ restore the pc
  181.  
  182.  
  183.     .sbttl    NAMCVT state transition table
  184.  
  185. ptable:
  186.  
  187. ; char    other    null    '[    ']    ':    '.    ',   letter/digit
  188. ; class      0      1     2     3     4     5     6      7
  189.  
  190.   .byte      1    ,30.    ,2    ,-1    ,11.    ,21.    ,-1    ,21.  ; init
  191.   .byte      2    ,30.    ,-1    ,3    ,-1    ,2    ,2    ,2    ; [ ]
  192.   .byte      3    ,30.    ,-1    ,-1    ,14.    ,23.    ,3    ,23.  ; [ ]x.x
  193.   .byte      4    ,30.    ,30.    ,-1    ,-1    ,24.    ,-1    ,24.  ; x.x
  194.  
  195. paction:            ; action routines for file name parsing
  196.     .word    null        ; null process, do nothing, ignore input char
  197.     .word    init        ; start over, hosing everything done prior
  198.     .word    copy        ; copy a valid char into the output string
  199.     .word    fin        ; done, append a dot if needed and exit
  200.  
  201.  
  202.     .psect    $code
  203.     .sbttl    Parse file specification to extract only filnam.typ
  204.  
  205. ;    input:     (r5)    address of source file_spec
  206. ;        2(r5)    resultant string address
  207. ;    output:   r0    error code, if any
  208. ;
  209. ;    internal register usage:
  210. ;    r0    =   action index
  211. ;    r1    =   current state
  212. ;    r2    =   input string pointer
  213. ;    r4    --> resultant string
  214.  
  215. namcvt::save    <r1,r2,r3,r4>
  216.     mov    @r5    ,r2        ; point to the input string
  217.     mov    2(r5)    ,r4        ; point to the output string
  218.     clrb    @r4            ; init output to be .asciz
  219.     mov    #1    ,r1        ; initialize current state
  220.     tst    rawfil            ; /54/ really string stuff?
  221.     beq    10$            ; /54/ yes
  222.     strcpy    r4    ,r2        ; /54/ no, copy as is
  223.     clr    r0            ; /54/ no errors
  224.     br    40$            ; /54/ and exit
  225.  
  226. 10$:    tst    r1            ; current state is zero?
  227.     beq    20$            ; yes, exit then
  228.     clr    r3            ; get the next ch please
  229.     bisb    (r2)+    ,r3        ; simple
  230.     bic    #^c<177>,r3        ; ensure in range 0..127
  231.     dec    r1            ; use previous state to get the
  232.     mul    #10    ,r1        ; index into the state table  line
  233.     movb    chtype(r3),r0        ; /BBS/                       column
  234.     add    r0    ,r1        ; add in the character class  line+col
  235.     movb    ptable(r1),r1        ; and get the new state of system
  236.     beq    20$            ; all done if new state is zero
  237.     bmi    30$            ; error exit if < 0
  238.     clr    r0            ; now mask off the action index from
  239.     div    #10.    ,r0        ; the new state
  240.     asl    r0            ; word indexing to action routine
  241.     jsr    pc    ,@paction(r0)    ; simple
  242.     br    10$            ; next please
  243.  
  244. 20$:    clr    r0            ; no errors
  245.     clrb    @r4            ; .asciz for output
  246.     br    40$
  247.  
  248. 30$:    mov    #-1    ,r0        ; error, bye
  249. 40$:    unsave    <r4,r3,r2,r1>
  250.     return
  251.  
  252.  
  253.     .sbttl    Action routines for the file name parser
  254.  
  255. null:    return
  256.  
  257. init:    mov    2(r5)    ,r4        ; re-init the output string address
  258.     clrb    @r4            ; /BBS/ re-init the output buffer
  259.     return
  260.  
  261. copy:    movb    r3    ,(r4)+        ; copy a byte
  262.     clrb    @r4            ; (re)terminate the string
  263.     return                ; next please
  264.  
  265. fin:    save    <r0,r3>            ; all done, look for a dot
  266.     mov    2(r5)    ,r0        ; if there isn't any, add one
  267.     tstb    @r0            ; /BBS/ is there anything left?
  268.     beq    30$            ; /BBS/ don't add a dot to nothing
  269. 10$:    tstb    @r0            ; end of the line yet?
  270.     beq    20$            ; yes
  271.     cmpb    @r0    ,#'.        ; a dot hanging around today?
  272.     beq    30$            ; yes, exit
  273.     inc    r0            ; no, bump to next char
  274.     br    10$            ; and try again please
  275. 20$:    movb    #'.    ,r3        ; no dot, stuff one in please
  276.     call    copy            ; simple
  277. 30$:    unsave    <r3,r0>
  278.     return
  279.  
  280.  
  281.     .sbttl    Check file extent to determine its type
  282.  
  283. ;    C H K E X T
  284. ;
  285. ;    input:     (r5)    = file name
  286. ;    output:      r0    = if <>, assume it's a binary file
  287.  
  288. chkext::save    <r1,r2,r3,r4>
  289.     mov    @r5    ,r1        ; /BBS/ save copy of pointer
  290.     strlen    r1            ; how much is left?
  291.     tst    r0            ; if nothing, then presume not binary
  292.     beq    80$            ; nothing to do, exit
  293.     add    r0    ,r1        ; point to the end of the file name
  294. 10$:    cmpb    -(r1)    ,#'.        ; look for a dot which will delimit
  295.     beq    20$            ; the file type
  296.     sob    r0    ,10$        ; not found, try again please
  297.     br    80$            ; never found a dot (can't happen)
  298. 20$:    copyz    r1    ,#chkbuf,#5    ; /BBS/ make a copy so spaces aren't
  299.     mov    #chkbuf    ,r1        ; /BBS/ written into actual name buff!
  300.     strlen    r1            ; # chars in file type, including "."
  301.     mov    #4    ,r3        ; /BBS/ flip operands for positive num
  302.     sub    r0    ,r3        ; /BBS/ must be 4 chars or less
  303.     beq    40$            ; /BBS/ it's exactly 4, on to testing
  304.     blt    80$            ; /BBS/ it's greater than 4, bail out
  305.     mov    r1    ,r2        ; /BBS/ save copy of pointer
  306.     add    r0    ,r2        ; /BBS/ point to last char
  307. 30$:    movb    #space    ,(r2)+        ; /BBS/ space pad file extent
  308.     sob    r3    ,30$        ; /BBS/ until total length is 4
  309.     clrb    @r2            ; /BBS/ null terminate padded string
  310.  
  311. 40$:    mov    bintyp    ,r2        ; ok, get listhead of file types
  312.     upcase    r1            ; /63/ upper case chkbuf
  313.  
  314. 50$:    mov    r2    ,r3        ; get next file type address
  315.     tstb    @r3            ; end of the list?
  316.     beq    80$            ; if null, then all done
  317.     mov    r1    ,r4        ; not done, get pointer to passed type
  318.     cmpb    (r4)+    ,(r3)+        ; /63/ skip past the dots
  319.     cmpb    (r4)+    ,(r3)+        ; /63/ look for match on file type
  320.     bne    60$            ; not bloody likely
  321.     cmpb    (r4)+    ,(r3)+        ; /63/ and so on
  322.     bne    60$            ; you know
  323.     cmpb    (r4)+    ,(r3)+        ; /63/ one more time
  324.     beq    70$            ; a match, go say so..
  325. 60$:    add    #4    ,r2        ; no match, bump to next one please
  326.     br    50$            ; and go give it a try
  327.  
  328. 70$:    mov    #1    ,r0        ; flag it's a binary file
  329.     br    90$
  330. 80$:    clr    r0            ; not binary
  331. 90$:    unsave    <r4,r3,r2,r1>
  332.     return
  333.  
  334.  
  335.     .sbttl    Init BINARY-TYPES list
  336.  
  337. binini::strcpy    bintyp    ,#binl        ; copy list to buffer in high memory
  338.     return                ; so appending it is possible
  339.  
  340.  
  341.     .sbttl    Convert invalid characters to something reasonable
  342.  
  343. ;    F I X F I L E
  344. ;
  345. ;    Input:     (r5)    = source string, .asciz
  346. ;        2(r5)    = destination string, .asciz
  347. ;    Output:      r0    = zero if unmodified, else non-zero (for warnings)
  348. ;
  349. ;    The main reason for this is to protect ourselves against the
  350. ;    file naming conventions used for TOPS20 and VMS so we do not
  351. ;    die on a bad file name.
  352.  
  353. ; /63/    Modified to accomodate Unix file names, general clean-up too.
  354.  
  355. fixfil::save    <r1,r2,r3>
  356.     sub    #256.    ,sp        ; buffer so src string stays intact
  357.     mov    sp    ,r1        ; pointer to it
  358.     copyz    (r5)    ,r1  ,#255.    ; copy input string into it
  359.     upcase    r1            ; upper case the copy
  360.     clr    r3            ; no mods made yet to file name
  361.  
  362. 10$:    tstb    (r1)            ; this is the replace bad chars loop
  363.     beq    30$            ; null = end of source file spec
  364.     scan    (r1)    ,#okchr        ; check for invalid character
  365.     tst    r0            ; did we find one?
  366.     bne    20$            ; no (we checked for legit chars)
  367.     movb    defchr    ,(r1)        ; ya, insert the fixup character
  368.     mov    #er$fnm    ,r3        ; and flag name has been modified
  369. 20$:    inc    r1            ; advance to next src char
  370.     br    10$            ; and go check it
  371.  
  372. 30$:    mov    sp    ,r1        ; restore pointer to temp buffer
  373.     mov    2(r5)    ,r2        ; dst string buffer address
  374.     scan    #':    ,r1        ; look for a device delimiter
  375.     tst    r0            ; find one?
  376.     beq    50$            ; no..
  377. 40$:    movb    (r1)+    ,(r2)+        ; ya, copy the device name
  378.     sob    r0    ,40$        ; including the colon terminator
  379. 50$:    mov    #6    ,r0        ; RT-11 file name is 6 chars max
  380.  
  381. 60$:    tstb    (r1)            ; anything now left?
  382.     beq    70$            ; no, must have at least 1 char
  383.     cmpb    (r1)    ,#'.        ; end of file name field?
  384.     bne    90$            ; not yet
  385.     inc    r1            ; if a dot, bump pointer past it
  386. 70$:    cmp    r0    ,#6        ; anything at all in the name field?
  387.     bne    100$            ; something has been copied there
  388.     movb    defchr    ,(r2)+        ; no, it must have at least 1 char
  389. 80$:    mov    #er$fnm    ,r3        ; flag that we altered name
  390.     br    100$            ; then continue
  391.  
  392. 90$:    movb    (r1)+    ,(r2)+        ; copy the character
  393.     sob    r0    ,60$        ; next please
  394.     scan    #'.    ,r1        ; now find next dot in input string
  395.     add    r0    ,r1        ; bump ptr past it (no dot = no bump)
  396.     dec    r0            ; next char was dot or no dot at all?
  397.     bgt    80$            ; no, so something had to be tossed..
  398.  
  399. 100$:    movb    #'.    ,(r2)+        ; stuff a dot in output string
  400.     mov    #3    ,r0        ; at most 3 chars in file type
  401.  
  402. 110$:    cmpb    (r1)    ,#'.        ; another dot??  (for unix!)
  403.     beq    120$            ; ya
  404.     cmpb    (r1)    ,#':        ; just in case, is it a colon?
  405.     bne    130$            ; no    (colon is not fixed above..)
  406. 120$:    tstb    (r1)+            ; ya, skip past this char
  407.     mov    #er$fnm    ,r3        ; and flag name was altered..
  408.     br    110$
  409.  
  410. 130$:    movb    (r1)+    ,(r2)+        ; finish off with the file type
  411.     beq    140$            ; hit the end of input string
  412.     sob    r0    ,110$        ; next char please
  413.     clrb    (r2)            ; .asciz
  414.     tstb    (r1)            ; anything left over?
  415.     beq    140$            ; nope..
  416.     mov    #er$fnm    ,r3        ; ya, flag type was truncated..
  417.  
  418. 140$:    add    #256.    ,sp        ; release temp buffer
  419.     mov    r3    ,r0        ; return status
  420.     unsave    <r3,r2,r1>
  421.     return
  422.  
  423.  
  424.     .sbttl    Convert strings ala abcde<15> or abcde\015 to binary format
  425.  
  426. prsarg::save    <r1,r2,r3,r4>        ; /45/ save regs
  427.     mov    argbuf    ,r3        ; /41/ argbuf address
  428.     mov    r0    ,r4        ; /41/ where to return parsed string
  429. 10$:    movb    (r3)+    ,r2        ; /41/ while (*argbuf)
  430.     beq    110$            ; /41/ exit with success
  431.     cmpb    r2    ,#'\        ; /45/ "C" style notation?
  432.     beq    50$            ; /45/ yes
  433.     cmpb    r2    ,#'<        ; /41/ start of an octal sequence?
  434.     bne    40$            ; /41/ no
  435.     clr    r1            ; /41/ init accumulator
  436. 20$:    movb    (r3)+    ,r2        ; /41/ while (*argbuf++)
  437.     beq    100$            ; /41/ error, no terminator
  438.     cmpb    r2    ,#'>        ; /41/ octal number terminator?
  439.     beq    30$            ; /41/ yes, exit loop
  440.     cmpb    r2    ,#'0        ; /41/ check for legitimate value
  441.     blo    100$            ; /41/ not an octal digit, error
  442.     cmpb    r2    ,#'7        ; /41/ check again please
  443.     bhi    100$            ; /41/ not legit, error
  444.     sub    #'0    ,r2        ; /41/ yes, convert to octal until ">"
  445.     ash    #3    ,r1        ; /62/ shift left 3 bits
  446.     add    r2    ,r1        ; /41/ add in current digit
  447.     br    20$            ; /41/ no
  448. 30$:    mov    r1    ,r2        ; /41/ yes, get set to insert value
  449. 40$:    movb    r2    ,(r4)+        ; /41/ place current char or value in
  450.     br    10$            ; /41/ next please
  451.  
  452. 50$:    clr    r1            ; /45/ "C" style notation
  453.     clr    -(sp)            ; /45/ trip counter
  454. 60$:    movb    (r3)    ,r2        ; /45/ copy a character
  455.     beq    70$            ; /45/ EOS, exit next time
  456.     cmpb    r2    ,#'0        ; /45/ octal characters?
  457.     blo    70$            ; /45/ no, exit this loop
  458.     cmpb    r2    ,#'7        ; /45/ ...
  459.     bhi    70$            ; /45/ copy the character
  460.     inc    (sp)            ; /45/ been here at least once
  461.     sub    #'0    ,r2        ; /45/ yes, convert to octal
  462.     ash    #3    ,r1        ; /62/ shift left 3 bits
  463.     add    r2    ,r1        ; /45/ add in current digit
  464.     inc    r3            ; /45/ next please
  465.     br    60$            ; /45/ do it
  466. 70$:    tst    (sp)+            ; /45/ did we really get a number?
  467.     beq    80$            ; /45/ no, ignore then
  468.     movb    r1    ,(r4)+        ; /45/ done, copy the data
  469.     br    90$            ; /45/ and get next please
  470. 80$:    tstb    r2            ; /45/ no number, perhaps "\\" or
  471.     beq    90$            ; /45/ or "\<" was present?
  472.     movb    r2    ,(r4)+        ; /45/ must have had "\x"
  473.     inc    r3            ; /45/ point to next char please
  474. 90$:    br    10$            ; /45/ go get it
  475.  
  476. 100$:    mov    #-1    ,r0        ; /41/ failed
  477.     br    120$            ; /41/ exit
  478. 110$:    clr    r0            ; /41/ success
  479. 120$:    clrb    @r4            ; /41/ ensure string is .asciz
  480.     unsave    <r4,r3,r2,r1>        ; /45/ unsave regs
  481.     return
  482.  
  483.     .end
  484.