-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.s
More file actions
63 lines (51 loc) · 1.47 KB
/
template.s
File metadata and controls
63 lines (51 loc) · 1.47 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
*----------------------------------------------------------------------
* Programmer:
* Class Account:
* Assignment or Title:
* Filename:
* Date completed:
*----------------------------------------------------------------------
* Problem statement:
* Input:
* Output:
* Error conditions tested:
* Included files:
* Method and/or pseudocode:
* References:
*----------------------------------------------------------------------
*
ORG $0
DC.L $3000 * Stack pointer value after a reset
DC.L start * Program counter value after a reset
ORG $3000 * Start at location 3000 Hex
*
*----------------------------------------------------------------------
*
#minclude /home/cs/faculty/cs237/bsvc/macros/iomacs.s
#minclude /home/cs/faculty/cs237/bsvc/macros/evtmacs.s
*
*----------------------------------------------------------------------
*
* Register use
*
*----------------------------------------------------------------------
*
fact: EQU $7000
start: initIO * Initialize (required for I/O)
setEVT * Error handling routines
* initF * For floating point macros only
//lineout PROMPT
linein buff
cvta2 buff,D0
move.l D0,D1
move.w D1,-(SP)
jsr fact
adda.l #2,SP
dump D0
break * Terminate execution
*
*----------------------------------------------------------------------
* Storage declarations
PROMPT: dc.b 'Enter a number',0
buff: ds.b 80
end