File: con_test.s

package info (click to toggle)
tkisem 4.5.12-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 964 kB
  • ctags: 1,372
  • sloc: cpp: 4,844; tcl: 3,047; asm: 1,991; makefile: 335; ansic: 269; sh: 155
file content (34 lines) | stat: -rw-r--r-- 683 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
	!
	! $Id: con_test.s 1.2 Mon, 11 Nov 1996 14:11:38 -0700 maccabe $
	!
	! read characters from the consol (directly)
	!
	! to run this test, type 20 characters in the consol input
	!  followed by a carriage return,
	! then (load and) run the program -- this should echo
	! the characters you typed to the consol output
	!
	.global	start
	
	CONSOLE = 0x110000
start:
	
	set	20, %l0		! read 20 characters
	set	CONSOLE, %l1	! the consol address

	set	'\n', %l3	! print a newline
	st	%l3, [%l1]
	
	ld	[%l1], %l2
top:	cmp	%l2, ~0		! no echo if nothing read
	be	test
	nop
	st	%l2, [%l1]
test:	
	deccc	%l0
	bg	top
	ld	[%l1], %l2	! branch delay slot

	st	%l3, [%l1]	! print a newline
	ta	0