.TITLE tstlookup - Test of Lookup Module .IDENT /1.7/ .REM | *+ tstlookup - Test of Lookup Module File:tstlookup.mac Version: 1.7 Author: Last Edit: 8-MAY-1985 10:13:16 Last Update: 8-May-1985 10:13:47 fix cbta params *- | .LIBRARY /LB:[1,1]GLMAC.MLB/ .MCALL QIOW$S, EXIT$S .SBTTL LOCAL DATA .psect ldat,d,lcl,con ; ; use this psect for scratch storage - it is not guaranteed to be saved ; across calls to the module ; ;@MARK@ .psect data,d,gbl,con ; ; use this psect for module-specific data which must be retained across ; calls to the module ; cmd: .word 0 ; holds returned command index iosb: .blkw 2 ; io status block Line: .blkb 80. ; input line prmpt: .ASCII /***>/ prmptl = .-prmpt rply: .ASCII /message number is / rpl2: .blkb 10. ; room for edmsg rpll = .-rply .PSECT ; code goes in the blank psect START: qiow$s #Io.rpr,#5,#1,,#iosb,,<#line,#80.,,#prmpt,#prmptl,#44> bcc 10$ mov $dsw, r0 mov #1, r1 iot 10$: cmpb #is.suc, iosb ; ok? beq 21$ ; yes - br cmpb #ie.eof, iosb ; end of file? bne 20$ ; nope - go die exit$s ; EOF -- just exit 20$: mov iosb, r0 ; get error code clr r1 ; flag point in program iot ; crash and burn ; we got a command, set up call to lookup 21$: mov #line, r0 ; point to input mov iosb+2, r1 ; get its length call lookup ; crypt and locate mov r2, r1 ; set up for output conversion mov #rpl2, r0 ; point to index output buff mov #10., r3 ; loop index 30$: clrb (r0)+ ; null out output buff sob r3, 30$ mov #rpl2, r0 ; point back to beginning mov #26012, r2 ; cbta params call $cbta ; convert ; dump out reply line qiow$s #io.wvb,#5,#1,,,,<#rply,#rpll,#40> ; ignore errors jmp start ; loop .end START