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