1 |
6 |
hellwig |
<HTML>
|
2 |
|
|
<HEAD>
|
3 |
|
|
<TITLE>Assembler Short Reference</TITLE>
|
4 |
|
|
</HEAD>
|
5 |
|
|
<BODY>
|
6 |
|
|
|
7 |
|
|
<H2>
|
8 |
|
|
ECO32 Instruction Set Architecture
|
9 |
|
|
</H2>
|
10 |
|
|
|
11 |
|
|
<TABLE BORDER=1>
|
12 |
|
|
<TR><TH> Format </TH><TH> Description </TH></TR>
|
13 |
|
|
<TR><TD> N </TD><TD> no operands </TD></TR>
|
14 |
|
|
<TR><TD> RH </TD><TD> one register and the lower 16 bits of a word </TD></TR>
|
15 |
|
|
<TR><TD> RHH </TD><TD> one register and the upper 16 bits of a word </TD></TR>
|
16 |
|
|
<TR><TD> RRH </TD><TD> two registers and a zero-extended halfword </TD></TR>
|
17 |
|
|
<TR><TD> RRS </TD><TD> two registers and a sign-extended halfword </TD></TR>
|
18 |
|
|
<TR><TD> RRR </TD><TD> three registers </TD></TR>
|
19 |
|
|
<TR><TD> RRX </TD><TD> three registers, or two registers and a zero-extended halfword </TD></TR>
|
20 |
|
|
<TR><TD> RRY </TD><TD> three registers, or two registers and a sign-extended halfword </TD></TR>
|
21 |
|
|
<TR><TD> RRB </TD><TD> two registers and a sign-extended 16 bit offset </TD></TR>
|
22 |
|
|
<TR><TD> J </TD><TD> no registers and a sign-extended 26 bit offset </TD></TR>
|
23 |
|
|
<TR><TD> JR </TD><TD> one register </TD></TR>
|
24 |
|
|
</TABLE>
|
25 |
|
|
|
26 |
|
|
<BR>
|
27 |
|
|
|
28 |
|
|
<TABLE BORDER=1>
|
29 |
|
|
<TR><TH> Mnemonic </TH><TH> Operands </TH><TH> Description </TH><TH> Format </TH></TR>
|
30 |
|
|
<TR><TD> add </TD><TD> dst, op1, op2 </TD><TD> dst := op1 + op2 </TD><TD> RRY </TD></TR>
|
31 |
|
|
<TR><TD> sub </TD><TD> dst, op1, op2 </TD><TD> dst := op1 - op2 </TD><TD> RRY </TD></TR>
|
32 |
|
|
<TR><TD> mul </TD><TD> dst, op1, op2 </TD><TD> dst := op1 * op2, signed </TD><TD> RRY </TD></TR>
|
33 |
|
|
<TR><TD> mulu </TD><TD> dst, op1, op2 </TD><TD> dst := op1 * op2, unsigned </TD><TD> RRX </TD></TR>
|
34 |
|
|
<TR><TD> div </TD><TD> dst, op1, op2 </TD><TD> dst := op1 / op2, signed </TD><TD> RRY </TD></TR>
|
35 |
|
|
<TR><TD> divu </TD><TD> dst, op1, op2 </TD><TD> dst := op1 / op2, unsigned </TD><TD> RRX </TD></TR>
|
36 |
|
|
<TR><TD> rem </TD><TD> dst, op1, op2 </TD><TD> dst := remainder of op1/op2, signed </TD><TD> RRY </TD></TR>
|
37 |
|
|
<TR><TD> remu </TD><TD> dst, op1, op2 </TD><TD> dst := remainder of op1/op2, unsigned </TD><TD> RRX </TD></TR>
|
38 |
|
|
<TR><TD> and </TD><TD> dst, op1, op2 </TD><TD> dst := bitwise AND of op1 and op2 </TD><TD> RRX </TD></TR>
|
39 |
|
|
<TR><TD> or </TD><TD> dst, op1, op2 </TD><TD> dst := bitwise OR of op1 and op2 </TD><TD> RRX </TD></TR>
|
40 |
|
|
<TR><TD> xor </TD><TD> dst, op1, op2 </TD><TD> dst := bitwise XOR of op1 and op2 </TD><TD> RRX </TD></TR>
|
41 |
|
|
<TR><TD> xnor </TD><TD> dst, op1, op2 </TD><TD> dst := bitwise XNOR of op1 and op2 </TD><TD> RRX </TD></TR>
|
42 |
|
|
<TR><TD> sll </TD><TD> dst, op1, op2 </TD><TD> dst := shift op1 logically left by op2 </TD><TD> RRX </TD></TR>
|
43 |
|
|
<TR><TD> slr </TD><TD> dst, op1, op2 </TD><TD> dst := shift op1 logically right by op2 </TD><TD> RRX </TD></TR>
|
44 |
|
|
<TR><TD> sar </TD><TD> dst, op1, op2 </TD><TD> dst := shift op1 arithmetically right by op2 </TD><TD> RRX </TD></TR>
|
45 |
|
|
<TR><TD> ldhi </TD><TD> dst, op1 </TD><TD> dst := op1 shifted left by 16 bits </TD><TD> RHH </TD></TR>
|
46 |
|
|
<TR><TD> beq </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 == op2 </TD><TD> RRB </TD></TR>
|
47 |
|
|
<TR><TD> bne </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 != op2 </TD><TD> RRB </TD></TR>
|
48 |
|
|
<TR><TD> ble </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 <= op2 (signed) </TD><TD> RRB </TD></TR>
|
49 |
|
|
<TR><TD> bleu </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 <= op2 (unsigned) </TD><TD> RRB </TD></TR>
|
50 |
|
|
<TR><TD> blt </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 < op2 (signed) </TD><TD> RRB </TD></TR>
|
51 |
|
|
<TR><TD> bltu </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 < op2 (unsigned) </TD><TD> RRB </TD></TR>
|
52 |
|
|
<TR><TD> bge </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 >= op2 (signed) </TD><TD> RRB </TD></TR>
|
53 |
|
|
<TR><TD> bgeu </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 >= op2 (unsigned) </TD><TD> RRB </TD></TR>
|
54 |
|
|
<TR><TD> bgt </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 > op2 (signed) </TD><TD> RRB </TD></TR>
|
55 |
|
|
<TR><TD> bgtu </TD><TD> op1, op2, offset </TD><TD> branch to PC+4+offset*4 if op1 > op2 (unsigned) </TD><TD> RRB </TD></TR>
|
56 |
|
|
<TR><TD> j </TD><TD> offset </TD><TD> jump to PC+4+offset*4 </TD><TD> J </TD></TR>
|
57 |
|
|
<TR><TD> jr </TD><TD> register </TD><TD> jump to register </TD><TD> JR </TD></TR>
|
58 |
|
|
<TR><TD> jal </TD><TD> offset </TD><TD> jump to PC+4+offset*4, store PC+4 in $31 </TD><TD> J </TD></TR>
|
59 |
|
|
<TR><TD> jalr </TD><TD> register </TD><TD> jump to register, store PC+4 in $31 </TD><TD> JR </TD></TR>
|
60 |
|
|
<TR><TD> trap </TD><TD> -/- </TD><TD> cause a trap, store PC in $30 </TD><TD> N </TD></TR>
|
61 |
|
|
<TR><TD> rfx </TD><TD> -/- </TD><TD> return from exception, restore PC from $30 </TD><TD> N </TD></TR>
|
62 |
|
|
<TR><TD> ldw </TD><TD> dst, reg, offset </TD><TD> dst := word @ (reg+offset) </TD><TD> RRS </TD></TR>
|
63 |
|
|
<TR><TD> ldh </TD><TD> dst, reg, offset </TD><TD> dst := sign-extended halfword @ (reg+offset) </TD><TD> RRS </TD></TR>
|
64 |
|
|
<TR><TD> ldhu </TD><TD> dst, reg, offset </TD><TD> dst := zero-extended halfword @ (reg+offset) </TD><TD> RRS </TD></TR>
|
65 |
|
|
<TR><TD> ldb </TD><TD> dst, reg, offset </TD><TD> dst := sign-extended byte @ (reg+offset) </TD><TD> RRS </TD></TR>
|
66 |
|
|
<TR><TD> ldbu </TD><TD> dst, reg, offset </TD><TD> dst := zero-extended byte @ (reg+offset) </TD><TD> RRS </TD></TR>
|
67 |
|
|
<TR><TD> stw </TD><TD> src, reg, offset </TD><TD> store src word @ (reg+offset) </TD><TD> RRS </TD></TR>
|
68 |
|
|
<TR><TD> sth </TD><TD> src, reg, offset </TD><TD> store src halfword @ (reg+offset) </TD><TD> RRS </TD></TR>
|
69 |
|
|
<TR><TD> stb </TD><TD> src, reg, offset </TD><TD> store src byte @ (reg+offset) </TD><TD> RRS </TD></TR>
|
70 |
|
|
<TR><TD> mvfs </TD><TD> dst, special </TD><TD> dst := contents of special register </TD><TD> RH </TD></TR>
|
71 |
|
|
<TR><TD> mvts </TD><TD> src, special </TD><TD> contents of special register := src </TD><TD> RH </TD></TR>
|
72 |
|
|
<TR><TD> tbs </TD><TD> -/- </TD><TD> TLB search </TD><TD> N </TD></TR>
|
73 |
|
|
<TR><TD> tbwr </TD><TD> -/- </TD><TD> TLB write random </TD><TD> N </TD></TR>
|
74 |
|
|
<TR><TD> tbri </TD><TD> -/- </TD><TD> TLB read index </TD><TD> N </TD></TR>
|
75 |
|
|
<TR><TD> tbwi </TD><TD> -/- </TD><TD> TLB write index </TD><TD> N </TD></TR>
|
76 |
|
|
</TABLE>
|
77 |
|
|
|
78 |
|
|
<BR>
|
79 |
|
|
|
80 |
|
|
<TABLE BORDER=1>
|
81 |
|
|
<TR><TH COLSPAN=8> Integer Registers </TH></TR>
|
82 |
|
|
<TR>
|
83 |
|
|
<TD> $0 </TD> <TD> always zero </TD>
|
84 |
|
|
<TD> $8 </TD> <TD> temporary register (caller-save) </TD>
|
85 |
|
|
<TD> $16 </TD> <TD> register variable (callee-save) </TD>
|
86 |
|
|
<TD> $24 </TD> <TD> temporary register (caller-save) </TD>
|
87 |
|
|
</TR>
|
88 |
|
|
<TR>
|
89 |
|
|
<TD> $1 </TD> <TD> reserved for assembler </TD>
|
90 |
|
|
<TD> $9 </TD> <TD> temporary register (caller-save) </TD>
|
91 |
|
|
<TD> $17 </TD> <TD> register variable (callee-save) </TD>
|
92 |
|
|
<TD> $25 </TD> <TD> temporary register (caller-save) </TD>
|
93 |
|
|
</TR>
|
94 |
|
|
<TR>
|
95 |
|
|
<TD> $2 </TD> <TD> func return value </TD>
|
96 |
|
|
<TD> $10 </TD> <TD> temporary register (caller-save) </TD>
|
97 |
|
|
<TD> $18 </TD> <TD> register variable (callee-save) </TD>
|
98 |
|
|
<TD> $26 </TD> <TD> reserved for OS kernel </TD>
|
99 |
|
|
</TR>
|
100 |
|
|
<TR>
|
101 |
|
|
<TD> $3 </TD> <TD> func return value </TD>
|
102 |
|
|
<TD> $11 </TD> <TD> temporary register (caller-save) </TD>
|
103 |
|
|
<TD> $19 </TD> <TD> register variable (callee-save) </TD>
|
104 |
|
|
<TD> $27 </TD> <TD> reserved for OS kernel </TD>
|
105 |
|
|
</TR>
|
106 |
|
|
<TR>
|
107 |
|
|
<TD> $4 </TD> <TD> proc/func argument </TD>
|
108 |
|
|
<TD> $12 </TD> <TD> temporary register (caller-save) </TD>
|
109 |
|
|
<TD> $20 </TD> <TD> register variable (callee-save) </TD>
|
110 |
|
|
<TD> $28 </TD> <TD> reserved for OS kernel </TD>
|
111 |
|
|
</TR>
|
112 |
|
|
<TR>
|
113 |
|
|
<TD> $5 </TD> <TD> proc/func argument </TD>
|
114 |
|
|
<TD> $13 </TD> <TD> temporary register (caller-save) </TD>
|
115 |
|
|
<TD> $21 </TD> <TD> register variable (callee-save) </TD>
|
116 |
|
|
<TD> $29 </TD> <TD> stack pointer </TD>
|
117 |
|
|
</TR>
|
118 |
|
|
<TR>
|
119 |
|
|
<TD> $6 </TD> <TD> proc/func argument </TD>
|
120 |
|
|
<TD> $14 </TD> <TD> temporary register (caller-save) </TD>
|
121 |
|
|
<TD> $22 </TD> <TD> register variable (callee-save) </TD>
|
122 |
|
|
<TD> $30 </TD> <TD> interrupt return address </TD>
|
123 |
|
|
</TR>
|
124 |
|
|
<TR>
|
125 |
|
|
<TD> $7 </TD> <TD> proc/func argument </TD>
|
126 |
|
|
<TD> $15 </TD> <TD> temporary register (caller-save) </TD>
|
127 |
|
|
<TD> $23 </TD> <TD> register variable (callee-save) </TD>
|
128 |
|
|
<TD> $31 </TD> <TD> proc/func return address </TD>
|
129 |
|
|
</TR>
|
130 |
|
|
</TABLE>
|
131 |
|
|
|
132 |
|
|
<BR>
|
133 |
|
|
|
134 |
|
|
<TABLE BORDER=1>
|
135 |
|
|
<TR><TH COLSPAN=8> Special Registers </TH></TR>
|
136 |
|
|
<TR>
|
137 |
|
|
<TD>0</TD><TD> Processor Status </TD>
|
138 |
|
|
</TR>
|
139 |
|
|
<TR>
|
140 |
|
|
<TD>1</TD><TD> TLB Index </TD>
|
141 |
|
|
<TD>2</TD><TD> TLB Entry High </TD>
|
142 |
|
|
<TD>3</TD><TD> TLB Entry Low </TD>
|
143 |
|
|
<TD>4</TD><TD> TLB Bad Address </TD>
|
144 |
|
|
</TR>
|
145 |
|
|
</TABLE>
|
146 |
|
|
|
147 |
|
|
<BR>
|
148 |
|
|
|
149 |
|
|
<TABLE BORDER=1>
|
150 |
|
|
<TR>
|
151 |
|
|
<TH COLSPAN=9> Processor Status Register </TH>
|
152 |
|
|
</TR><TR>
|
153 |
|
|
<TD> 31 .. 27 </TD>
|
154 |
|
|
<TD> 26 </TD><TD> 25 </TD><TD> 24 </TD>
|
155 |
|
|
<TD> 23 </TD><TD> 22 </TD><TD> 21 </TD>
|
156 |
|
|
<TD> 20 .. 16 </TD>
|
157 |
|
|
<TD> 15 .. 0 </TD>
|
158 |
|
|
</TR><TR>
|
159 |
|
|
<TD></TD>
|
160 |
|
|
<TD COLSPAN=3> User Mode </TD>
|
161 |
|
|
<TD COLSPAN=3> Interrupt Enable </TD>
|
162 |
|
|
<TD> Priority </TD>
|
163 |
|
|
<TD> Interupt Mask </TD>
|
164 |
|
|
</TR><TR>
|
165 |
|
|
<TD></TD>
|
166 |
|
|
<TD> Cur </TD><TD> Prv </TD><TD> Old </TD>
|
167 |
|
|
<TD> Cur </TD><TD> Prv </TD><TD> Old </TD>
|
168 |
|
|
<TD> 0 .. 31 </TD>
|
169 |
|
|
<TD></TD>
|
170 |
|
|
</TR>
|
171 |
|
|
</TABLE>
|
172 |
|
|
|
173 |
|
|
</BODY>
|
174 |
|
|
</HTML>
|