.Title PUTLIST Alvin String List - Level 5 .Psect ALVIN,Con,Gbl .Mcall $REGS,$ALVIN ;; $REGS ;Define Registers. $ALVIN ;Define Alvin constants, assemble to proper level (version). ;; ;;********* Internal Globals: ;; .Globl Msge,PutList ;; ;;********* External Globals: ;; .Globl Send,AlvIdle ;+ ;;********************************************************************** ;; SUBROUTINE TO LIST STATIC STRINGS USING THE ALVIN LIST DEVICE. ;; ADAPTS STRINGS DEFINED BY A STATIC STRING DESCRIPTOR, IE. ;; STATIC_STRING_DESC: .WORD (BEGINING ADDRESS OF STRING) ;; .WORD (ENDING ADDRESS OF STRING) ;; GUARANTEES PREVIOUS MESSAGE HAS PRINTED. ;; RETURNS TO USER AS SOON AS MESSAGE BEGINS PRINTING. ;; Note that the asynchronous nature of PutList requires that a ;; string just listed remains static; double buffering may be ;; required if multiple strings are being constructed as they are ;; being listed. ;; 10-Feb-86 DJ If an invalid string descriptor is passed (start > end) ;; as can be the case with an empty command string, Putlist simply ;; returns. ;; ;; Expects calls of the form: ;; ;; JSR R5,PUTList ;or can use MSGE (PutStr is being phased out.) ;; .WORD (STATIC STRING DESCRIPTOR ADDRESS) ;; ;; NOTE: If the static string descriptor address is zero, then ;; this address is assumed to be in register 3. ;; MSGE: ;ALIAS ; PutString: ;Alias - Obsolete, being phased out. ;- PUTList: MOV R4,-(SP) ;SAVE REGISTERS USED Mov R0,-(SP) ;Save R0 which Send will use. MOV (R5)+,R4 ;GET ADR OF STATIC STRING DESC Bne PUTSET ;If non-zero, then desc in now in reg 4. MOV R3,R4 ;If zero, then desc was passed in reg 3. PUTSET: Cmp (R4),2(R4) ; Is this a valid static string? Bhi Putsx ; No, branch. Cannot be listed. ; (An Aleda error code could be returned.) JSR R5,SEND ;SEND THE MESSAGE .WORD LIST!String ; which is a string descriptor .WORD 0 ; which is already in register 4. BR Putswait ;If cannot list then branch (assume it is busy). Br Putsx ;Exit if the list did begin. PutsWait: Jsr Pc,AlvIdle ;Must wait - Let Alvin do some busy work. Br PutSet ;On return, try list again. PUTSX: Mov (Sp)+,R0 ;Restore original Register 0 contents. MOV (SP)+,R4 ;Restore register used. RTS R5 ;RETURN ;;**************************** .End