                 .ORIG x3000
;; program to test strinput subroutine
;; this program reads in two strings using trap x30 (string input) 
;; then displays them using PUTS
;;
;; this program must be loaded with trap30.obj
;; and init30.obj

start	lea	r0 buf1		;address of first buffer
	trap	x30		;read the string into buffer

	lea	r0 buf2		;address of 2nd buffer
	trap	x30		;read the string into buffer

	lea	r0 prompt	;tell user you'll print the strings
	puts
	jsr 	crlf		;print a newline

	lea	r0 buf1		;print the first string
	puts
	jsr	crlf

	lea	r0 buf2		;print the 2nd string
	puts
	jsr	crlf

	halt

buf1	.blkw #81
buf2	.blkw #81
prompt	.stringz "Here are your two strings"

;subroutine to output a newline character (carriage return/line feed)
crlf	st	r0 sr0
	st	r7 save7
	ld	r0 NL
	out
	ld	r0 sr0
	ld	r7 save7
	ret

sr0	.blkw 1
save7	.blkw 1
NL	.fill xA

	.end
