.TITLE GETADR .IDENT /01/ .GLOBL GETADR ;+ ; GETADR ; CALL GETADR (IADDR, ARG1, ARG2, .... ARGn) ; ; where IADDR is an array of dimension n, will return the ; address of each argument or 0 if the argument ; does not exist. IADDR is I*4 array (NOT PDP-11 ; compatable) ; ; On entry the call frame looks line Number of Arguments ; Address of array ; Address of argument 1 ; . . . . . ; Address of argument n ; ;- .ENTRY GETADR ^M MOVL (AP)+,R4 ; Get # of arguments TSTB R4 ; Any arguments BEQL DONE ; Exit if no arguments MOVL (AP)+,R2 ; Get address of array 10$: DECB R4 ; Decrement argument counter BEQL DONE ; If zero, then done MOVL (AP)+,R3 ; Get Address of next argument MOVL R3,(R2) ; It exists, set address 20$: TSTL (R2)+ ; Point to next address BRB 10$ ; Look for more work DONE: RET ; and done .END