File: user.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 (50 lines) | stat: -rw-r--r-- 939 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
	
! user.s - this is the user level code used to test the timer device
!
!	this file should be loaded before the supervisor code has been
!	loaded. 
!
!
!	One word of caution.... make sure that the user level program
!		starts at location 0x20 -- or change the definition
!		of MAIN in the start_timer. code

	SAFE = 4000	! the address of a safe location in the user's
			! data segment -- the timer interrupt will
			! increment this value


	!----------------------------------------------------------------------
	! start:
	!	just wait for a wile and print the value in
	!	memory location 4
	!
	.text
	.global start
start:
	! clear the value in memory location 4000
	set	SAFE, %i0
	clr	[%i0]


	! set up the outer loop
	set	20, %l0
top_outer:	
	
	! inner delay loop
	set	400, %l1
	deccc	%l0
top_inner:
	bne	top_inner
	deccc	%l1

	! report the value in memory location 4000
	ld	[%i0], %o0
	ta	4
	
	deccc	%l0
	bne	top_outer
	nop
	
	ta	0