|
|
1.1 root 1:
2:
3: /* SUBB3 (subtract byte 3) test */
4: /* */
5: /*Test name = subb3 */
6: /*Description = */
7: /* This test checks 'subb3' instruction as follows: */
8: /*sub min dif 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 _subb3
102: _subb3:
103: callf $4,_setjmp /* save context for error return */
104: movab _subb3,_stpc /* starting address of subtest */
105: movl $1,_subtst /* subtest number */
106: movl $2,_no_opr /* number of operands in use */
107: movl $SB1,_opr /* first operand in use */
108: movl $MB1,_opr + 4 /* second operand */
109: 0: bicpsw $PSWMASK /*PSW = 0 */
110: movl $SB1,sub /*first operand */
111: movl $MB1,min /*second operand */
112: movl $INITB,dif /*initialize destination */
113: bicpsw $PSWMASK /*PSW = 0 */
114: bispsw $(N|V|C) /* these flags ON */
115: subb3 sub+3,min+3,dif+3/* try 'sub' instruction mem mem mem */
116: jlss e1 /*error if N = 1 */
117: jneq e1 /*error if Z = 0 */
118: jvs e1 /*error if V = 1 */
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 $RB1,dif /*dif = expected ? */
127: jeql sb2
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 $RB1,_expected /* expected data */
132: jmp *badrtn
133:
134: sb2:
135: bbs $0,_force_lp,0b /* if set loop on last subtest */
136: as2: callf $4,_setjmp /* save context for error return */
137: movab as2,_stpc /* starting address of subtest */
138: movl $2,_subtst /* subtest number */
139: movl $2,_no_opr /* number of operands in use */
140: movl $SB2,_opr /* first operand in use */
141: movl $MB2,_opr + 4 /* second operand */
142: movl $SB2,r6 /*first operand */
143: movl $MB2,r7 /*second operand */
144: movl $0,r8 /*initialize destination */
145: 0: bicpsw $PSWMASK /*PSW = 0 */
146: bispsw $(N|Z|V) /* these flags ON */
147: subb3 r6,r7,r8 /* try 'sub' instruction reg reg reg */
148: jgeq e2 /*error if N = 1 */
149: jeql e2 /*error if Z = 1 */
150: jvs e2 /*error if V = 1 */
151: jcs e2 /*error if C = 1 */
152: jmp 1f
153: e2: movpsl _actual /* actual = psl maybe incorrect */
154: bbs $0,_scoplp,0b /* if set scope loop on error */
155: movl $2,_ercode /* error code flag failure */
156: jmp *badrtn
157: 1: bicpsw $Z
158: cmpl $0xffffff02,r8 /*r8= expected ? */
159: jeql sb3
160: bbs $0,_scoplp,0b /* if set scope loop on error */
161: movl $1,_ercode /* error code data miscompare */
162: movl r8,_actual /* actual data */
163: movl $0xffffff02,_expected /* expected data */
164: jmp *badrtn
165:
166:
167:
168: sb3:
169: bbs $0,_force_lp,0b /* if set loop on last subtest */
170: as3: callf $4,_setjmp /* save context for error return */
171: movab as3,_stpc /* starting address of subtest */
172: movl $3,_subtst /* subtest number */
173: movl $2,_no_opr /* number of operands in use */
174: movl $SB3,_opr /* first operand in use */
175: movl $MB3,_opr + 4 /* second operand */
176: 0: bicpsw $PSWMASK /*PSW = 0 */
177: movl $SB3,r6 /*first operand */
178: movl $MB3,r7 /*second operand */
179: movl $0,dif /*initialize destination */
180: bicpsw $PSWMASK /*PSW = 0 */
181: bispsw $(V|Z|C) /* these flags ON */
182: subb3 r6,r7,dif+3 /* try 'sub' instruction reg reg mem */
183: jlss e3 /*error if N = 0 */
184: jeql e3 /*error if Z = 1 */
185: jvs e3 /*error if V = 1 */
186: jcc e3 /*error if C = 0 */
187: jmp 1f
188: e3: movpsl _actual /* actual = psl maybe incorrect */
189: bbs $0,_scoplp,0b /* if set scope loop on error */
190: movl $2,_ercode /* error code flag failure */
191: jmp *badrtn
192: 1: bicpsw $Z
193: cmpl $RB3,dif /*dif = expected ? */
194: jeql sb4
195: bbs $0,_scoplp,0b /* if set scope loop on error */
196: movl $1,_ercode /* error code data miscompare */
197: movl dif,_actual /* actual data */
198: movl $RB3,_expected /* expected data */
199: jmp *badrtn
200:
201:
202: sb4:
203: bbs $0,_force_lp,0b /* if set loop on last subtest */
204: as4: callf $4,_setjmp /* save context for error return */
205: movab as4,_stpc /* starting address of subtest */
206: movl $4,_subtst /* subtest number */
207: movl $2,_no_opr /* number of operands in use */
208: movl $SB4,_opr /* first operand in use */
209: movl $MB4,_opr + 4 /* second operand */
210: 0: bicpsw $PSWMASK /*PSW = 0 */
211: movl $SB4,r6 /*first operand */
212: movl $MB4,min /*second operand */
213: movl $0,r8 /*initialize destination */
214: bicpsw $PSWMASK /*PSW = 0 */
215: bispsw $Z /* these flags ON */
216: subb3 r6,min+3,r8 /* try 'sub' instruction reg mem reg */
217: jgeq e4 /*error if N = 0 */
218: jeql e4 /*error if Z = 1 */
219: jvc e4 /*error if V = 0 */
220: jcs e4 /*error if C = 1 */
221: jmp 1f
222: e4: movpsl _actual /* actual = psl maybe incorrect */
223: bbs $0,_scoplp,0b /* if set scope loop on error */
224: movl $2,_ercode /* error code flag failure */
225: jmp *badrtn
226: 1: bicpsw $Z
227: cmpl $0xfffffffe,r8 /* r8 = expected ? */
228: jeql sb5
229: bbs $0,_scoplp,0b /* if set scope loop on error */
230: movl $1,_ercode /* error code data miscompare */
231: movl r8,_actual /* actual data */
232: movl $0xfffffffe,_expected /* expected data */
233: jmp *badrtn
234:
235:
236:
237: sb5:
238: bbs $0,_force_lp,0b /* if set loop on last subtest */
239: as5: callf $4,_setjmp /* save context for error return */
240: movab as5,_stpc /* starting address of subtest */
241: movl $5,_subtst /* subtest number */
242: movl $2,_no_opr /* number of operands in use */
243: movl $SB5,_opr /* first operand in use */
244: movl $MB5,_opr + 4 /* second operand */
245: 0: bicpsw $PSWMASK /*PSW = 0 */
246: movl $SB5,r6 /*first operand */
247: movl $MB5,min /*second operand */
248: movl $0,r8 /*initialize destination */
249: bicpsw $PSWMASK /*PSW = 0 */
250: bispsw $(V|Z) /* these flags ON */
251: subb3 r6,$MB5,r8 /* try 'sub' instruction reg data reg */
252: jgeq e5 /*error if N = 0 */
253: jeql e5 /*error if Z = 1 */
254: jvs e5 /*error if V = 1 */
255: jcs e5 /*error if C = 1 */
256: jmp 1f
257: e5: movpsl _actual /* actual = psl maybe incorrect */
258: bbs $0,_scoplp,0b /* if set scope loop on error */
259: movl $2,_ercode /* error code flag failure */
260: jmp *badrtn
261: 1: bicpsw $Z
262: cmpl $RL5,r8 /*r8= expected ? */
263: jeql sb6
264: bbs $0,_scoplp,0b /* if set scope loop on error */
265: movl $1,_ercode /* error code data miscompare */
266: movl r8,_actual /* actual data */
267: movl $RL5,_expected /* expected data */
268: jmp *badrtn
269:
270:
271:
272: sb6:
273: bbs $0,_force_lp,0b /* if set loop on last subtest */
274: as6: callf $4,_setjmp /* save context for error return */
275: movab as6,_stpc /* starting address of subtest */
276: movl $6,_subtst /* subtest number */
277: movl $2,_no_opr /* number of operands in use */
278: movl $SB6,_opr /* first operand in use */
279: movl $MB6,_opr + 4 /* second operand */
280: 0: bicpsw $PSWMASK /*PSW = 0 */
281: movl $SB6,r6 /*first operand */
282: movl $MB6,min /*second operand */
283: movl $0,dif /*initialize destination */
284: bicpsw $PSWMASK /*PSW = 0 */
285: bispsw $(Z|C|N) /* these flags ON */
286: subb3 r6,min+3,dif+3 /* try 'sub' instruction reg mem mem */
287: jgeq e6 /*error if N = 1 */
288: jeql e6 /*error if Z = 1 */
289: jvc e6 /*error if V = 0 */
290: jcc e6 /*error if C = 0 */
291: jmp 1f
292: e6: movpsl _actual /* actual = psl maybe incorrect */
293: bbs $0,_scoplp,0b /* if set scope loop on error */
294: movl $2,_ercode /* error code flag failure */
295: jmp *badrtn
296: 1: bicpsw $Z
297: cmpl $RB6,dif /*dif = expected ? */
298: jeql sb7
299: bbs $0,_scoplp,0b /* if set scope loop on error */
300: movl $1,_ercode /* error code data miscompare */
301: movl dif,_actual /* actual data */
302: movl $RB6,_expected /* expected data */
303: jmp *badrtn
304:
305: sb7:
306: bbs $0,_force_lp,0b /* if set loop on last subtest */
307: as7: callf $4,_setjmp /* save context for error return */
308: movab as7,_stpc /* starting address of subtest */
309: movl $7,_subtst /* subtest number */
310: movl $2,_no_opr /* number of operands in use */
311: movl $SB6,_opr /* first operand in use */
312: movl $MB6,_opr + 4 /* second operand */
313: 0: bicpsw $PSWMASK /*PSW = 0 */
314: movl $SB6,r6 /*first operand */
315: movl $0,dif /*initialize destination */
316: bicpsw $PSWMASK /*PSW = 0 */
317: bispsw $(Z|C|N) /* these flags ON */
318: subb3 r6,$MB6,dif+3 /* try 'sub' instruction reg data mem */
319: jlss e7 /*error if N = 1 */
320: jeql e7 /*error if Z = 1 */
321: jvc e7 /*error if V = 0 */
322: jcc e7 /*error if C = 0 */
323: jmp 1f
324: e7: movpsl _actual /* actual = psl maybe incorrect */
325: bbs $0,_scoplp,0b /* if set scope loop on error */
326: movl $2,_ercode /* error code flag failure */
327: jmp *badrtn
328: 1: bicpsw $Z
329: cmpl $RB6,dif /*dif = expected ? */
330: jeql sb8
331: bbs $0,_scoplp,0b /* if set scope loop on error */
332: movl $1,_ercode /* error code data miscompare */
333: movl dif,_actual /* actual data */
334: movl $RB6,_expected /* expected data */
335: jmp *badrtn
336:
337: sb8:
338: bbs $0,_force_lp,0b /* if set loop on last subtest */
339: as8: callf $4,_setjmp /* save context for error return */
340: movab as8,_stpc /* starting address of subtest */
341: movl $8,_subtst /* subtest number */
342: movl $2,_no_opr /* number of operands in use */
343: movl $SB5,_opr /* first operand in use */
344: movl $MB5,_opr + 4 /* second operand */
345: 0: bicpsw $PSWMASK /*PSW = 0 */
346: movl $SB5,sub /*first operand */
347: movl $MB5,r7 /*second operand */
348: movl $0,r8 /*initialize destination */
349: bicpsw $PSWMASK /*PSW = 0 */
350: bispsw $(V|Z) /* these flags ON */
351: subb3 sub+3,r7,r8 /* try 'sub' instruction mem reg reg */
352: jlss e8 /*error if N = 0 */
353: jeql e8 /*error if Z = 1 */
354: jvs e8 /*error if V = 1 */
355: jcs e8 /*error if C = 1 */
356: jmp 1f
357: e8: movpsl _actual /* actual = psl maybe incorrect */
358: bbs $0,_scoplp,0b /* if set scope loop on error */
359: movl $2,_ercode /* error code flag failure */
360: jmp *badrtn
361: 1: bicpsw $Z
362: cmpl $RB5,r8 /*r8= expected ? */
363: jeql sb9
364: bbs $0,_scoplp,0b /* if set scope loop on error */
365: movl $1,_ercode /* error code data miscompare */
366: movl r8,_actual /* actual data */
367: movl $RB5,_expected /* expected data */
368: jmp *badrtn
369:
370:
371:
372: sb9:
373: bbs $0,_force_lp,0b /* if set loop on last subtest */
374: as9: callf $4,_setjmp /* save context for error return */
375: movab as9,_stpc /* starting address of subtest */
376: movl $9,_subtst /* subtest number */
377: movl $2,_no_opr /* number of operands in use */
378: movl $SB6,_opr /* first operand in use */
379: movl $MB6,_opr + 4 /* second operand */
380: 0: bicpsw $PSWMASK /*PSW = 0 */
381: movl $MB6,r7 /*second operand */
382: movl $0,r8 /*initialize destination */
383: bicpsw $PSWMASK /*PSW = 0 */
384: bispsw $(Z|C|N) /* these flags ON */
385: subb3 $SB6,r7,r8 /* try 'sub' instruction data reg reg */
386: jlss e9 /*error if N = 1 */
387: jeql e9 /*error if Z = 1 */
388: jvc e9 /*error if V = 0 */
389: jcc e9 /*error if C = 0 */
390: jmp 1f
391: e9: movpsl _actual /* actual = psl maybe incorrect */
392: bbs $0,_scoplp,0b /* if set scope loop on error */
393: movl $2,_ercode /* error code flag failure */
394: jmp *badrtn
395: 1: bicpsw $Z
396: cmpl $RB6,r8 /*dif = expected ? */
397: jeql sb10
398: bbs $0,_scoplp,0b /* if set scope loop on error */
399: movl $1,_ercode /* error code data miscompare */
400: movl r8,_actual /* actual data */
401: movl $RB6,_expected /* expected data */
402: jmp *badrtn
403:
404:
405: sb10:
406: bbs $0,_force_lp,0b /* if set loop on last subtest */
407: as10: callf $4,_setjmp /* save context for error return */
408: movab as10,_stpc /* starting address of subtest */
409: movl $0xa,_subtst /* subtest number */
410: movl $2,_no_opr /* number of operands in use */
411: movl $SB5,_opr /* first operand in use */
412: movl $MB5,_opr + 4 /* second operand */
413: 0: bicpsw $PSWMASK /*PSW = 0 */
414: movl $SB5,sub /*first operand */
415: movl $MB5,r7 /*second operand */
416: movl $0, dif /*initialize destination */
417: bicpsw $PSWMASK /*PSW = 0 */
418: bispsw $(V|Z) /* these flags ON */
419: subb3 sub+3,r7,dif+3 /* try 'sub' instruction mem reg mem */
420: jlss e10 /*error if N = 0 */
421: jeql e10 /*error if Z = 1 */
422: jvs e10 /*error if V = 1 */
423: jcs e10 /*error if C = 1 */
424: jmp 1f
425: e10: movpsl _actual /* actual = psl maybe incorrect */
426: bbs $0,_scoplp,0b /* if set scope loop on error */
427: movl $2,_ercode /* error code flag failure */
428: jmp *badrtn
429: 1: bicpsw $Z
430: cmpl $RB5,dif /*dif = expected ? */
431: jeql sb11
432: bbs $0,_scoplp,0b /* if set scope loop on error */
433: movl $1,_ercode /* error code data miscompare */
434: movl dif,_actual /* actual data */
435: movl $RB5,_expected /* expected data */
436: jmp *badrtn
437:
438:
439: sb11:
440: bbs $0,_force_lp,0b /* if set loop on last subtest */
441: as11: callf $4,_setjmp /* save context for error return */
442: movab as11,_stpc /* starting address of subtest */
443: movl $0xb,_subtst /* subtest number */
444: movl $2,_no_opr /* number of operands in use */
445: movl $SB5,_opr /* first operand in use */
446: movl $MB5,_opr + 4 /* second operand */
447: 0: bicpsw $PSWMASK /*PSW = 0 */
448: movl $MB5,r7 /*second operand */
449: movl $0,dif /*initialize destination */
450: bicpsw $PSWMASK /*PSW = 0 */
451: bispsw $(V|Z) /* these flags ON */
452: subb3 $SB5,r7,dif+3 /* try 'sub' instruction data reg mem */
453: jgeq e11 /*error if N = 0 */
454: jeql e11 /*error if Z = 1 */
455: jvs e11 /*error if V = 1 */
456: jcs e11 /*error if C = 1 */
457: jmp 1f
458: e11: movpsl _actual /* actual = psl maybe incorrect */
459: bbs $0,_scoplp,0b /* if set scope loop on error */
460: movl $2,_ercode /* error code flag failure */
461: jmp *badrtn
462: 1: bicpsw $Z
463: cmpl $RB5,dif /* dif = expected ? */
464: jeql sb12
465: bbs $0,_scoplp,0b /* if set scope loop on error */
466: movl $1,_ercode /* error code data miscompare */
467: movl dif,_actual /* actual data */
468: movl $RB5,_expected /* expected data */
469: jmp *badrtn
470:
471:
472: sb12:
473: bbs $0,_force_lp,0b /* if set loop on last subtest */
474: as12: callf $4,_setjmp /* save context for error return */
475: movab as12,_stpc /* starting address of subtest */
476: movl $0xc,_subtst /* subtest number */
477: movl $2,_no_opr /* number of operands in use */
478: movl $SB5,_opr /* first operand in use */
479: movl $MB5,_opr + 4 /* second operand */
480: 0: bicpsw $PSWMASK /*PSW = 0 */
481: movl $0,r8 /*initialize destination */
482: bicpsw $PSWMASK /*PSW = 0 */
483: bispsw $(V|Z) /* these flags ON */
484: subb3 $SB5,$MB5,r8 /* try 'sub' instruction data data reg */
485: jgeq e12 /*error if N = 0 */
486: jeql e12 /*error if Z = 1 */
487: jvs e12 /*error if V = 1 */
488: jcs e12 /*error if C = 1 */
489: jmp 1f
490: e12: movpsl _actual /* actual = psl maybe incorrect */
491: bbs $0,_scoplp,0b /* if set scope loop on error */
492: movl $2,_ercode /* error code flag failure */
493: jmp *badrtn
494: 1: bicpsw $Z
495: cmpl $RL5,r8 /*r8= expected ? */
496: jeql aldn
497: bbs $0,_scoplp,0b /* if set scope loop on error */
498: movl $1,_ercode /* error code data miscompare */
499: movl r8,_actual /* actual data */
500: movl $RB5,_expected /* expected data */
501: jmp *badrtn
502:
503: aldn: bbs $0,_force_lp,0b /* if set loop on last subtest */
504: jmp *return
505:
506: /* */
507: /* Variables */
508: /* */
509: .align 2
510: min: .space 4
511: dif: .space 4
512: sub: .space 4
513:
514: /* End of file */
515:
516:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.