|
|
1.1 root 1:
2:
3: /* SUBA (subtract address) test */
4: /* */
5: /*Test name = suba */
6: /*Description = */
7: /* This test checks 'suba' instruction as follows: */
8: /*sub dif result N Z V C (flags) */
9: /*___ ___ ______ _______________ */
10: /*0x7f 0x7f 0x00 0 1 0 1 */
11: /*0xff 0x01 0x02 0 0 0 0 */
12: /*0x01 0xff 0xfe 1 0 0 1 */
13: /*0x81 0x7f 0xfe 1 0 1 0 */
14: /*0x81 0x80 0xff 1 0 0 0 */
15: /*0x7f 0x81 0x02 0 0 1 1 */
16: /* */
17: /* */
18:
19: /* */
20: /* */
21: /* constants definition for 'subx' tests. */
22: /* */
23:
24: .set SB1,0x11111f7f/*+127, highest +ve number, byte */
25: .set SW1,0x111f7fff
26: .set SL1,0x7fffffff
27: .set MB1,0x11111f7f/* +127 */
28: .set MW1,0x111f7fff
29: .set ML1,SL1
30: .set RB1,0x11111f00
31: .set RW1,0x111f0000
32: .set RL1,0x00000000
33: .set SB2,0xff /* -1 */
34: .set SW2,0xffff
35: .set SL2,0xffffffff
36: .set MB2,0x01 /* +1 */
37: .set MW2,0x0001
38: .set ML2,0X00000001
39: .set RB2,0x00000002 /* +2 */
40: .set RW2,RB2
41: .set RL2,RB2
42: .set SB3,MB2 /* +1 */
43: .set SW3,MW2
44: .set SL3,ML2
45: .set MB3,0xff /* -1 */
46: .set MW3,0xffff
47: .set ML3,0xffffffff
48: .set RB3,0x000000fe /* -2 */
49: .set RW3,0x0000fffe
50: .set RL3,0Xfffffffe
51: .set SB4,0x81 /* -127 */
52: .set SW4,0x8001
53: .set SL4,0x80000001
54: .set MB4,0x7f /* 127 */
55: .set MW4,0x7fff
56: .set ML4,0x7fffffff
57: .set RB4,0xfe /* -2 */
58: .set RW4,0xfffe
59: .set RL4,0xfffffffe
60: .set SB5,SB4 /* -127 */
61: .set SW5,SW4
62: .set SL5,SL4
63: .set MB5,0x80 /* -128 */
64: .set MW5,0x8000
65: .set ML5,0x80000000
66: .set RB5,0xff /* -1 */
67: .set RW5,0xffff
68: .set RL5,0xffffffff
69: .set SB6,0x7f/* +127 */
70: .set SW6,0x7fff
71: .set SL6,0x7fffffff
72: .set MB6,SB4 /* -127 */
73: .set MW6,SW4
74: .set ML6,SL4
75: .set RB6,0x02
76: .set RW6,0x02
77: .set RL6,0x02
78:
79: .set INITB,0x11111f55/* initialization values for 3 operand */
80: .set INITW,0x111f5555
81: .set INITL,0X55555555
82:
83: /* */
84: /* Syst.s - Constants */
85: /* */
86: .set IPL,8
87: .set HIGH,31
88: .set ZERO,0
89: .set ONES,0xffffffff
90: .set N,8
91: .set Z,4
92: .set V,2
93: .set C,1
94: .set T,16
95: .set IV,32
96: .set FU,64
97: .set DV,128
98: .set PSWMASK,0x003f
99:
100:
101: .globl _sub_a
102: _sub_a:
103: sl1:
104: callf $4,_setjmp /* save context for error return */
105: movab sl1,_stpc /* save address of subtest start */
106: movl $1,_subtst /* subtest number */
107: movl $2,_no_opr /* number of operands in use */
108: movl $SL1,_opr /* first operand */
109: movl $ML1,_opr + 4 /* second operand */
110: 0:
111: movl $SL1,sub /*first operand */
112: movl $ML1,dif /*second operand */
113: bicpsw $PSWMASK /*PSW = 0 */
114: bispsw $(N|V|C) /* these flags ON */
115: suba sub,dif /* try 'sub' instruction mem to mem */
116: jgtr e1 /*error if N = 0 */
117: jeql e1 /*error if Z = 1 */
118: jvc e1 /*error if V = 0 */
119: jcc e1 /*error if C = 0 */
120: jmp 1f
121: e1: movpsl _actual /* actual = psl maybe incorrect */
122: bbs $0,_scoplp,0b /* if set scope loop on error */
123: movl $2,_ercode /* error code flag failure */
124: jmp *badrtn
125: 1: bicpsw $Z
126: cmpl $RL1,dif /*dif = expected ? */
127: jeql sl2 /* if no error continue */
128: bbs $0,_scoplp,0b /* if set scope loop on error */
129: movl $1,_ercode /* error code data miscompare */
130: movl dif,_actual /* actual data */
131: movl $RL1,_expected /* expected data */
132: jmp *badrtn
133:
134: sl2:
135: bbs $0,_force_lp,0b /* if set loop on error */
136: as2: callf $4,_setjmp /* save context for error return */
137: movab as2,_stpc /* save address of subtest start */
138: movl $2,_subtst /* subtest number */
139: movl $2,_no_opr /* number of operands in use */
140: movl $SL2,_opr /* first operand */
141: movl $ML2,_opr + 4 /* second operand */
142: 0: movl $SL2,r5 /*first operand */
143: movl $ML2,dif /*second operand */
144: bicpsw $PSWMASK /*PSW = 0 */
145: bispsw $(N|Z|V) /* these flags ON */
146: suba r5,dif /* try 'sub' instruction reg to mem */
147: jgtr e2 /*error if N = 0 */
148: jneq e2 /*error if Z = 0 */
149: jvc e2 /*error if V = 0 */
150: jcs e2 /*error if C = 1 */
151: jmp 1f
152: e2: movpsl _actual /* actual = psl maybe incorrect */
153: bbs $0,_scoplp,0b /* if set scope loop on error */
154: movl $2,_ercode /* error code flag failure */
155: jmp *badrtn
156: 1: bicpsw $Z
157: cmpl $RL2,dif /*dif = expected ? */
158: jeql sl3 /* if no error continue */
159: bbs $0,_scoplp,0b /* if set scope loop on error */
160: movl $1,_ercode /* error code data miscompare */
161: movl dif,_actual /* actual data */
162: movl $RL2,_expected /* expected data */
163: jmp *badrtn
164:
165:
166:
167: sl3:
168: bbs $0,_force_lp,0b /* if set loop on error */
169: as3: callf $4,_setjmp /* save context for error return */
170: movab as3,_stpc /* save address of subtest start */
171: movl $3,_subtst /* subtest number */
172: movl $2,_no_opr /* number of operands in use */
173: movl $SL3,_opr /* first operand */
174: movl $ML3,_opr + 4 /* second operand */
175: 0: movl $ML3,r5 /*second operand */
176: bicpsw $PSWMASK /*PSW = 0 */
177: bispsw $(V|Z|C) /* these flags ON */
178: suba $SL3,r5 /* try 'sub' instruction data to reg */
179: jlss e3 /*error if N = 1 */
180: jneq e3 /*error if Z = 0 */
181: jvc e3 /*error if V = 0 */
182: jcc e3 /*error if C = 0 */
183: jmp 1f
184: e3: movpsl _actual /* actual = psl maybe incorrect */
185: bbs $0,_scoplp,0b /* if set scope loop on error */
186: movl $2,_ercode /* error code flag failure */
187: jmp *badrtn
188: 1: bicpsw $Z
189: cmpl $RL3,r5 /*dif = expected ? */
190: jeql sl4 /* if no error continue */
191: bbs $0,_scoplp,0b /* if set scope loop on error */
192: movl $1,_ercode /* error code data miscompare */
193: movl r5,_actual /* actual data */
194: movl $RL3,_expected /* expected data */
195: jmp *badrtn
196:
197: sl4:
198: bbs $0,_force_lp,0b /* if set loop on error */
199: as4: callf $4,_setjmp /* save context for error return */
200: movab as4,_stpc /* save address of subtest start */
201: movl $4,_subtst /* subtest number */
202: movl $2,_no_opr /* number of operands in use */
203: movl $SL4,_opr /* first operand */
204: movl $ML4,_opr + 4 /* second operand */
205: 0: movl $SL4,r6 /*first operand */
206: movl $ML4,r5 /*second operand */
207: bicpsw $PSWMASK /*PSW = 0 */
208: bispsw $Z /* these flags ON */
209: suba r6,r5 /* try 'sub' instruction reg to reg */
210: jlss e4 /*error if N = 1 */
211: jneq e4 /*error if Z = 0 */
212: jvs e4 /*error if V = 1 */
213: jcs e4 /*error if C = 1 */
214: jmp 1f
215: e4: movpsl _actual /* actual = psl maybe incorrect */
216: bbs $0,_scoplp,0b /* if set scope loop on error */
217: movl $2,_ercode /* error code flag failure */
218: jmp *badrtn
219: 1: bicpsw $Z
220: cmpl $RL4,r5 /*dif = expected ? */
221: jeql sl5 /* if no error continue */
222: bbs $0,_scoplp,0b /* if set scope loop on error */
223: movl $1,_ercode /* error code data miscompare */
224: movl r5,_actual /* actual data */
225: movl $RL4,_expected /* expected data */
226: jmp *badrtn
227:
228:
229: sl5:
230: bbs $0,_force_lp,0b /* if set loop on error */
231: as5: callf $4,_setjmp /* save context for error return */
232: movab as5,_stpc /* save address of subtest start */
233: movl $5,_subtst /* subtest number */
234: movl $2,_no_opr /* number of operands in use */
235: movl $SL5,_opr /* first operand */
236: movl $ML5,_opr + 4 /* second operand */
237: 0: movl $ML5,dif
238: bicpsw $PSWMASK /*PSW = 0 */
239: bispsw $(V|Z) /* these flags ON */
240: suba $SL5,dif /* try 'sub' instruction data to mem */
241: jlss e5 /*error if N = 1 */
242: jneq e5 /*error if Z = 0 */
243: jvc e5 /*error if V = 0 */
244: jcs e5 /*error if C = 1 */
245: jmp 1f
246: e5: movpsl _actual /* actual = psl maybe incorrect */
247: bbs $0,_scoplp,0b /* if set scope loop on error */
248: movl $2,_ercode /* error code flag failure */
249: jmp *badrtn
250: 1: bicpsw $Z
251: cmpl $RL5,dif /*dif = expected ? */
252: jeql sl6 /* if no error continue */
253: bbs $0,_scoplp,0b /* if set scope loop on error */
254: movl $1,_ercode /* error code data miscompare */
255: movl r5,_actual /* actual data */
256: movl $RL5,_expected /* expected data */
257: jmp *badrtn
258:
259:
260:
261: sl6:
262: bbs $0,_force_lp,0b /* if set loop on error */
263: as6: callf $4,_setjmp /* save context for error return */
264: movab as6,_stpc /* save address of subtest start */
265: movl $5,_subtst /* subtest number */
266: movl $2,_no_opr /* number of operands in use */
267: movl $SL6,_opr /* first operand */
268: movl $ML6,_opr + 4 /* second operand */
269: 0: movl $SL6,sub /*first operand */
270: movl $ML6,dif /*second operand */
271: bicpsw $PSWMASK /*PSW = 0 */
272: bispsw $(Z|C|N) /* these flags ON */
273: suba sub,dif /* try 'sub' instruction */
274: jgtr e6 /*error if N = 0 */
275: jneq e6 /*error if Z = 0 */
276: jvs e6 /*error if V = 1 */
277: jcc e6 /*error if C = 0 */
278: jmp 1f
279: e6: movpsl _actual /* actual = psl maybe incorrect */
280: bbs $0,_scoplp,0b /* if set scope loop on error */
281: movl $2,_ercode /* error code flag failure */
282: jmp *badrtn
283: 1: bicpsw $Z
284: cmpl $RL6,dif /*dif = expected ? */
285: jeql aldn /* if no error continue */
286: bbs $0,_scoplp,0b /* if set scope loop on error */
287: movl $1,_ercode /* error code data miscompare */
288: movl r5,_actual /* actual data */
289: movl $RL5,_expected /* expected data */
290: jmp *badrtn
291:
292:
293:
294: aldn: bbs $0,_force_lp,0b /* if set loop on error */
295: jmp *return
296:
297:
298: /* */
299: /* Variables */
300: /* */
301: .align 2
302: min: .space 4
303: dif: .space 4
304: sub: .space 4
305:
306: /* End of file */
307:
308:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.