.TITLE ASKACR ; ; .IDENT /Y07.00/ ; ; ; .ENABL LC ; ; ; Copyright (C) Shell Research Ltd. 1979 ; ; ; The copyright in this computer program and associated user ; instructions contained in this document is the property of ; Shell Research Ltd.. No guarantee is given or may be implied ; as to the adequacy of the program or its suitability for any ; particular purpose and no liability is accepted for any loss ; or damage arising out of its use. ; ; ; ; Version: Y07 ; ; ; Author: R J Carpenter 7-Nov-79 ; ; ; Revised: R J Carpenter 29-FEB-84 ; ; .page .sbttl description ; ; ;++ ; This module does all the argument checking for the ASK suite. ;-- ; ; .page .sbttl macros and definitions ; .psect $ask$ ; .dsabl gbl ; .page .sbttl initialisation ; ; $askac:: ; ; set up all the defaults ; clrb qmin ;assume no user supplied min clrb qmax ; " " " " max clrb qdflt ;assume " " " default ; ; .page .sbttl arguement checking code ; ; ; see which args the user has supplied ; mov (r5),r0 ;get the number of args. bic #^c377,r0 ;ensure no garbage beq askext ;br if no args. ; ; cmp 2(r5),#-1 ;string addr valid ? bne 10$ ;br if yes mov stradr,2(r5) ;else use our internal default 10$: dec r0 ;we put away one arg. beq askext ;can use other routines to print strings ; ; cmp 4(r5),#-1 ;is it the target ? beq askext ;no action if not dec r0 ;any more args ? beq scopy ;br if not ; cmp 6(r5),#-1 ;is it the min ? beq 20$ ;br if not movb #377,qmin ;say lo limit supplied 20$: dec r0 ;any more args ? beq scopy ;br if not ; ; cmp 10(r5),#-1 ;max value supplied ? beq 30$ ;br if not movb #377,qmax ;say hi limit valid 30$: dec r0 ;any more args ? beq scopy ;br if not ; cmp 12(r5),#-1 ;default value supplied ? beq scopy ;br if not movb #377,qdflt ;say default supplied ; ; .page .sbttl string copying code ; ; scopy: clr r0 ;set up char. count mov #qlin,r4 ;set up string start addr. in r4 tstb qvtmd ;in video mode ? bne 10$ ;br if yes ; movb #12,(r4)+ ;push the line feed inc r0 ;inc char count ; 10$: mov 2(r5),r1 ;get the string start addr. into r1 20$: tstb (r1) ;is it null ? beq 30$ ;br if yes cmpb (r1),#200 ;is it 200 ? beq 30$ ;br if yes movb (r1)+,(r4)+ ;copy byte inc r0 ;inc char count br 20$ ;go for more ; 30$: mov r0,ipoint ;save char count ; askext: return ;return to caller ; ; .page .sbttl argument and data areas ; ; ; stradr: .word askstr ; askstr: .word 0 ; .end