|
|
1.1 root 1:
2:
3: /* constants definition for convert instruction */
4: /* */
5: /* */
6: extern long scoplp;
7: extern long force_lp;
8:
9: #define CVTBW 0x99 /*opcodes */
10: #define CVTBL 0x89
11: #define CVTWB 0x33
12: #define CVTWL 0x23
13: #define CVTLB 0x6f
14: #define CVTLW 0x7f
15: asm(".set PSWMASK,0xf");
16: #define MAX_PATTERNS 4
17:
18: #define IDESTB1 0x1111007f /*destination */
19: /*initial values */
20: #define IDESTB2 0x1111aa00 /*for bw,bl */
21: #define IDESTB3 0x1111aaaa
22: #define IDESTB4 0x1111ffff
23:
24:
25: #define IDESTWL1 0x1111007f /* wl */
26: #define IDESTWL2 0x1111aa00
27: #define IDESTWL3 0x1111aaaa
28: #define IDESTWL4 0x11110000
29:
30:
31: #define IDESTWB1 0x111180ff /* wb */
32: #define IDESTWB2 0x11110000
33: #define IDESTWB3 0x11117f80
34: #define IDESTWB4 0x11110080
35:
36:
37: #define IDESTLW1 0xffff0000 /* lw */
38: #define IDESTLW2 0x00008000
39: #define IDESTLW3 0x8000ffff
40: #define IDESTLW4 0x00007fff
41:
42:
43: #define IDESTLB1 0xffffff00 /* lb */
44: #define IDESTLB2 0x00000080
45: #define IDESTLB3 0x800000ff
46: #define IDESTLB4 0x0000007f
47:
48:
49: #define SB1 0x11110080 /*source values */
50: #define SB2 0x1111aa7f /* bw, bl */
51: #define SB3 0x1111aa00
52: #define SB4 0x11110000
53:
54: #define SWL1 0x11118000 /* wl */
55: #define SWL2 0x11117fff
56: #define SWL3 0x11110000
57: #define SWL4 0x11111111
58:
59: #define SWB1 0x11118000 /* wb */
60: #define SWB2 0x111100ff
61: #define SWB3 0x11117f7f
62: #define SWB4 0x1111007f
63:
64: #define SLW1 0xffffffff /*lw */
65: #define SLW2 0x00007fff
66: #define SLW3 0x80000000
67: #define SLW4 0x00008000
68:
69: #define SLB1 0xffffffff /* lb */
70: #define SLB2 0x0000007f
71: #define SLB3 0x80000000
72: #define SLB4 0x00000080
73:
74:
75: #define EXPBW1 0x1111ff80 /*expected destination */
76: #define EXPBW2 0x1111007f /* bw */
77: #define EXPBW3 0x11110000
78: #define EXPBW4 0x11110000
79:
80: #define EXPBL1 0xffffff80 /* bl */
81: #define EXPBL2 0x0000007f
82: #define EXPBL3 0x00000000
83: #define EXPBL4 0x00000000
84:
85: #define EXPWL1 0xffff8000 /* wl */
86: #define EXPWL2 0x00007fff
87: #define EXPWL3 0
88: #define EXPWL4 0x00001111
89:
90: #define EXPWB1 0x11118000 /* wb */
91: #define EXPWB2 0x111100ff
92: #define EXPWB3 0x11117f7f
93: #define EXPWB4 0x1111007f
94:
95:
96: #define FLG1 7 /*initial flags */
97: #define FLG2 8 /* bw, bl, wl */
98: #define FLG3 0
99: #define FLG4 0
100:
101: #define FLGW1 9 /* wb */
102: #define FLGW2 5
103: #define FLGW3 15
104: #define FLGW4 15
105:
106: #define FLGL1 7 /* lw, lb */
107: #define FLGL2 15
108: #define FLGL3 0
109: #define FLGL4 0
110:
111:
112:
113: #define EFLG1 9 /*expected flags */
114: #define EFLG2 1 /* bw, bl */
115: #define EFLG3 5
116: #define EFLG4 5
117:
118: #define EFLGWL1 9 /* wl */
119: #define EFLGWL2 1
120: #define EFLGWL3 5
121: #define EFLGWL4 1
122:
123: #define EFLGWB1 11 /* wb */
124: #define EFLGWB2 3
125: #define EFLGWB3 3
126: #define EFLGWB4 1
127:
128: #define EFLGL1 9 /* lw, lb */
129: #define EFLGL2 1
130: #define EFLGL3 11
131: #define EFLGL4 3
132:
133:
134:
135: #define ERROR1 1 /*error definitions */
136: #define ERROR2 2
137: #define ERROR3 3
138: #define ERROR4 4
139: #define ERROR5 5
140: /*error messages */
141: #define EM1 "destination not equal to expected \n"
142: #define EM2 "source altered by the instruction \n"
143: #define EM3 "flags not equal to expected \n"
144:
145:
146: /* standard definition file */
147: /* for 'C' diagnostic porgrams. */
148: /* */
149: /* */
150: #define HIGH 31
151: #define IPL 18
152: #define PSWMASK 255
153: #define T 16
154: #define IV 32
155: #define FU 64
156: #define DV 128
157: #define FLAGS 0x0000000f
158:
159:
160:
161:
162:
163:
164: /* Global variables for convert test */
165: /* */
166: /* */
167:
168: static short index = 0;
169: static long dest = 0; /*destination location */
170: static long source = 0; /*source location */
171: static long psw; /*processor status word */
172: static long error_count = 0;
173:
174: /*initial flag values */
175: static long flag_valueb[MAX_PATTERNS] = {FLG1,FLG2,FLG3,FLG4};
176: static long flag_valuewl[MAX_PATTERNS] = {FLG1,FLG2,FLG3,FLG4};
177: static long flag_valuewb[MAX_PATTERNS] = {FLGW1,FLGW2,FLGW3,FLGW4};
178: static long flag_valuel[MAX_PATTERNS] = {FLGL1,FLGL2,FLGL3,FLGL4};
179:
180:
181: /*expected destination */
182: static long expbw[MAX_PATTERNS] = {EXPBW1,EXPBW2,EXPBW3,EXPBW4};
183: static long expbl[MAX_PATTERNS] = {EXPBL1,EXPBL2,EXPBL3,EXPBL4};
184: static long expwl[MAX_PATTERNS] = {EXPWL1,EXPWL2,EXPWL3,EXPWL4};
185: static long expwb[MAX_PATTERNS] = {EXPWB1,EXPWB2,EXPWB3,EXPWB4};
186: static long explw[MAX_PATTERNS] = {SLW1,SLW2,SLW3,SLW4};
187: static long explb[MAX_PATTERNS] = {SLB1,SLB2,SLB3,SLB4};
188:
189:
190: /*expected psw */
191: static long exp_pswb[MAX_PATTERNS] = {EFLG1,EFLG2,EFLG3,EFLG4};
192: static long exp_pswwl[MAX_PATTERNS] = {EFLGWL1,EFLGWL2,EFLGWL3,EFLGWL4};
193: static long exp_pswwb[MAX_PATTERNS] = {EFLGWB1,EFLGWB2,EFLGWB3,EFLGWB4};
194: static long exp_pswl[MAX_PATTERNS] = {EFLGL1,EFLGL2,EFLGL3,EFLGL4};
195:
196:
197: /*source values */
198: static long sourceb[MAX_PATTERNS] = {SB1,SB2,SB3,SB4};
199: static long sourcewl[MAX_PATTERNS] = {SWL1,SWL2,SWL3,SWL4};
200: static long sourcewb[MAX_PATTERNS] = {SWB1,SWB2,SWB3,SWB4};
201: static long sourcelw[MAX_PATTERNS] = {SLW1,SLW2,SLW3,SLW4};
202: static long sourcelb[MAX_PATTERNS] = {SLB1,SLB2,SLB3,SLB4};
203:
204:
205: /*initial destination values */
206: static long destb[MAX_PATTERNS] = {IDESTB1,IDESTB2,IDESTB3,IDESTB4};
207: static long destwl[MAX_PATTERNS] = {IDESTWL1,IDESTWL2,IDESTWL3,IDESTWL4};
208: static long destwb[MAX_PATTERNS] = {IDESTWB1,IDESTWB2,IDESTWB3,IDESTWB4};
209: static long destlw[MAX_PATTERNS] = {IDESTLW1,IDESTLW2,IDESTLW3,IDESTLW4};
210: static long destlb[MAX_PATTERNS] = {IDESTLB1,IDESTLB2,IDESTLB3,IDESTLB4};
211:
212: static char *tst_name;
213: convert()
214: {
215: asm("movl $2,_no_opr");
216: tst_name = " ** CVTLB ** \n";
217: cvtlb();
218: tst_name = " ** CVTLW ** \n";
219: cvtlw();
220: tst_name = " ** CVTBL ** \n";
221: cvtbl();
222: tst_name = " ** CVTWL ** \n";
223: cvtwl(); /* convert word to long */
224: tst_name = " ** CVTWB ** \n";
225: cvtwb(); /* convert word to byte */
226: tst_name = " ** CVTBW ** \n";
227: cvtbw(); /* convert byte to word */
228: asm("jmp *return");
229: }
230:
231: static long *p_destwb;
232: static long *p_destb;
233: static long *p_destlb;
234: static long *p_destlw;
235: static long *p_destwl;
236: static long *p_exp_pswb;
237: static long *p_exp_pswl;
238: static long *p_exp_pswwb;
239: static long *p_exp_pswwl;
240: static long *p_expbl;
241: static long *p_expbw;
242: static long *p_explb;
243: static long *p_explw;
244: static long *p_expwb;
245: static long *p_expwl;
246: static long *p_sourceb;
247: static long *p_sourcelb;
248: static long *p_sourcelw;
249: static long *p_sourcewb;
250: static long *p_sourcewl;
251:
252: static init_ptr()
253: {
254: p_destwb = destwb;
255: p_destb = destb;
256: p_destlb = destlb;
257: p_destlw = destlw;
258: p_destwl = destwl;
259: p_exp_pswb = exp_pswb;
260: p_exp_pswl = exp_pswl;
261: p_exp_pswwb = exp_pswwb;
262: p_exp_pswwl = exp_pswwl;
263: p_expbl = expbl;
264: p_expbw = expbw;
265: p_explb = explb;
266: p_explw = explw;
267: p_expwb = expwb;
268: p_expwl = expwl;
269: p_sourceb = sourceb;
270: p_sourcelb = sourcelb;
271: p_sourcelw = sourcelw;
272: p_sourcewb = sourcewb;
273: p_sourcewl = sourcewl;
274: }
275:
276: static bump_ptr()
277: {
278: p_destwb++;
279: p_destb++;
280: p_destlb++;
281: p_destlw++;
282: p_destwl++;
283: p_exp_pswb++;
284: p_exp_pswl++;
285: p_exp_pswwb++;
286: p_exp_pswwl++;
287: p_expbl++;
288: p_expbw++;
289: p_explb++;
290: p_explw++;
291: p_expwb++;
292: p_expwl++;
293: p_sourceb++;
294: p_sourcelb++;
295: p_sourcelw++;
296: p_sourcewb++;
297: p_sourcewl++;
298: }
299:
300: static cvtwb() /* convert word to byte test */
301: {
302: asm("bicpsw $PSWMASK"); /*psw = 0*/
303: for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
304: {
305: t_cvtwb ();
306: t_cvtwb1(); /*one more test where */
307: /* dest address = source address */
308: }
309: }
310:
311:
312: static t_cvtwb() /*single test called by main test*/
313: {
314: for ( ; ; )
315: {
316: setjmp();
317: asm("c1: movab c1,_stpc");
318: asm("movl $1,_subtst");
319: dest = *p_destwb; /*initialize dest.,source & psw */
320: source = *p_sourcewb;
321: asm("movw _index,r10");
322: asm("bicpsw $PSWMASK");
323: asm("bispsw _flag_valuewb[r10]");
324: /*execute cvt instruction */
325: asm("cvtwb _source+2,_dest+3"); /* memory to memory */
326: asm("movpsl _psw"); /*save psw */
327: psw &= FLAGS; /*mask out all bits except flag bits */
328: if (dest != *p_expwb)
329: {
330: asm("movl $1,_ercode");
331: if (scoplp) longjmp();
332: error(dest,*p_expwb,source,*p_destwb,*p_expwb,dest);
333: }
334: if (source != *p_sourcewb)
335: {
336: asm("movl $3,_ercode");
337: if (scoplp) longjmp();
338: error(source,*p_sourcewb,source,*p_destwb);
339: }
340: if (psw != *p_exp_pswwb)
341: {
342: asm("movl $2,_ercode");
343: if (scoplp) longjmp();
344: error(psw,*p_exp_pswwb,source,dest);
345: }
346: if (force_lp) longjmp();
347: else
348: return(0); /*no error exit*/
349: }
350: }
351:
352:
353: /*single test 1 called by main test*/
354: /*source location = destination location*/
355: static t_cvtwb1()
356: {
357:
358: for ( ; ; )
359: {
360: /*initialize source, & psw */
361: setjmp();
362: asm("c2: movab c2,_stpc");
363: asm("movl $2,_subtst");
364: source = *p_sourcewb;
365: asm("movw _index,r10");
366: asm("movw _source+2,r5"); /* load first operand register */
367: asm("movl _source,r6"); /* load first operand register */
368: asm("bicpsw $PSWMASK");
369: asm("bispsw _flag_valuel[r10]");
370: /*execute cvt instruction */
371: asm("cvtwb r5,r6"); /* register to register */
372: asm("movpsl _psw"); /*save psw */
373: psw &= FLAGS; /*mask out all bits except flag bits */
374: source = *p_expwb;
375: if (source != *p_expwb)
376: {
377: asm("movl $1,_ercode");
378: if (scoplp) longjmp();
379: error(source,*p_expwb,*p_sourcewb,*p_sourcewb);
380: }
381: if (psw != *p_exp_pswwb)
382: {
383: asm("movl $1,_ercode");
384: if (scoplp) longjmp();
385: error(psw,*p_exp_pswwb,*p_sourcewb,*p_sourcewb);
386: }
387: if (force_lp) longjmp();
388: else
389: return(0); /*no error exit*/
390: }
391: }
392:
393:
394:
395: static cvtwl() /* convert word to long test */
396: {
397: asm("bicpsw $PSWMASK"); /*psw = 0*/
398: for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
399: {
400: t_cvtwl ();
401: t_cvtwl1(); /*one more test where */
402: /* dest address = source address */
403: }
404: }
405:
406: static t_cvtwl() /*single test called by main test*/
407: {
408: for ( ; ; )
409: {
410: setjmp();
411: asm("c3: movab c3,_stpc");
412: asm("movl $3,_subtst");
413: dest = *p_destwl; /*initialize dest., source, & psw */
414: source = *p_sourcewl;
415: asm("movw _index,r10");
416: asm("bicpsw $PSWMASK");
417: asm("bispsw _flag_valueb[r10]");
418: /*execute cvt instruction */
419: asm("cvtwl _source+2,_dest"); /* memory to memory */
420: asm("movpsl _psw"); /*save psw */
421: psw &= FLAGS; /*mask out all bits except flag bits */
422: if (dest != *p_expwl)
423: {
424: asm("movl $1,_ercode");
425: if (scoplp) longjmp();
426: error(dest,*p_destwl,source,*p_destwl);
427: }
428: if (source != *p_sourcewl)
429: {
430: asm("movl $3,_ercode");
431: if (scoplp) longjmp();
432: error(source,*p_sourcewl,source,*p_destwl);
433: }
434: if (psw != *p_exp_pswwl)
435: {
436: asm("movl $2,_ercode");
437: if (scoplp) longjmp();
438: error(psw,*p_exp_pswwl,source,*p_destwl);
439: }
440: if (force_lp) longjmp();
441: else
442: return(0); /*no error exit*/
443: }
444: }
445:
446:
447:
448: /*single test 1 called by main test*/
449: /* register to register operation */
450: static t_cvtwl1()
451: {
452:
453: for ( ; ; )
454: {
455: /*initialize source, & psw */
456: setjmp();
457: asm("c4: movab c4,_stpc");
458: asm("movl $4,_subtst");
459: source = *p_sourcewl;
460: asm("movw _index,r10");
461: asm("movw _source+2,r5"); /* load first operand register */
462: asm("movl _source,r6"); /* load second operand register */
463: asm("bicpsw $PSWMASK");
464: asm("bispsw _flag_valueb[r10]");
465: /*execute cvt instruction */
466: asm("cvtwl r5,r6"); /* register to register operation */
467: asm("movpsl _psw"); /*save psw */
468: psw &= FLAGS; /*mask out all bits except flag bits */
1.1.1.2 ! root 469: asm("movl r6,_source"); /* reload source location */
1.1 root 470: if (source != *p_expwl)
471: {
472: asm("movl $1,_ercode");
473: if (scoplp) longjmp();
474: error(source,*p_sourcewl,*p_sourcewl,*p_sourcewl);
475: }
476: if (psw != *p_exp_pswwl)
477: {
478: asm("movl $2,_ercode");
479: if (scoplp) longjmp();
480: error(psw,*p_exp_pswwl,*p_sourcewl,*p_sourcewl);
481: }
482: if (force_lp) longjmp();
483: else
484: return(0); /*no error exit*/
485: } /*end of for loop*/
486: } /*end of test*/
487:
488:
489:
490: static cvtbw() /* convert byte to long test */
491:
492: {
493: asm("bicpsw $PSWMASK"); /*psw = 0*/
494: for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
495: {
496: t_cvtbw ();
497: t_cvtbw1(); /*one more test where */
498: /* dest address = source address */
499: }
500: }
501:
502: static t_cvtbw() /*single test called by main test*/
503: {
504: for ( ; ; )
505: {
506: setjmp();
507: asm("c5: movab c5,_stpc");
508: asm("movl $5,_subtst");
509: dest = *p_destb; /*initialize destination, source, & psw */
510: source = *p_sourceb;
511: asm("movw _index,r10");
512: asm("bicpsw $PSWMASK");
513: asm("bispsw _flag_valueb[r10]");
514: /*execute cvt instruction */
515: asm("cvtbw _source+3,_dest+2"); /* memory to memory */
516: asm("movpsl _psw"); /*save psw */
517: psw &= FLAGS; /*mask out all bits except flag bits */
518: if (dest != *p_expbw)
519: {
520: asm("movl $1,_ercode");
521: if (scoplp) longjmp();
522: error(dest,*p_expbw,source,*p_destb);
523: }
524: if (source != *p_sourceb)
525: {
526: asm("movl $3,_ercode");
527: if (scoplp) longjmp();
528: error(source,*p_sourceb,source,*p_destb);
529: }
530: if (psw != *p_exp_pswb)
531: {
532: asm("movl $2,_ercode");
533: if (scoplp) longjmp();
534: error(psw,*p_exp_pswb,source,*p_destb);
535: }
536: if (force_lp) longjmp();
537: else
538: return(0); /*no error exit*/
539: }
540: }
541:
542: /*single test 1 called by main test*/
543: /*source location = destination location*/
544: static t_cvtbw1()
545: {
546: for ( ; ; )
547: {
548: /*initialize source, & psw */
549: setjmp();
550: asm("c6: movab c6,_stpc");
551: asm("movl $6,_subtst");
552: source = *p_sourceb;
553: asm("movb _source+3,r5"); /* load first operand register */
554: asm("movl _source,r6"); /* load second operand register */
555: asm("movw _index,r10");
556: asm("bicpsw $PSWMASK");
557: asm("bispsw _flag_valueb[r10]");
558: /*execute cvt instruction */
559: asm("cvtbw _source+3,_source+2"); /* register to register */
560: asm("movpsl _psw"); /*save psw */
561: psw &= FLAGS; /*mask out all bits except flag bits */
562: if (source != *p_expbw)
563: {
564: asm("movl $1,_ercode");
565: if (scoplp) longjmp();
566: error(source,*p_expbw,*p_sourceb,*p_sourceb);
567: }
568: if (psw != *p_exp_pswb)
569: {
570: asm("movl $2,_ercode");
571: if (scoplp) longjmp();
572: error(psw,*p_exp_pswb,*p_sourceb,*p_sourceb);
573: }
574: if (force_lp) longjmp();
575: else
576: return(0); /*no error exit*/
577: } /*end of for loop*/
578: } /*end of test*/
579:
580:
581:
582:
583: static cvtlb() /* convert long to byte */
584: {
585: asm("bicpsw $PSWMASK"); /*psw = 0*/
586: for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
587: {
588: t_cvtlb ();
589: t_cvtlb1(); /*one more test where */
590: /* dest address = source address */
591: }
592: }
593:
594: static t_cvtlb() /*single test called by main test*/
595: {
596:
597: for ( ; ; )
598: {
599: setjmp();
600: asm("c7: movab c7,_stpc");
601: asm("movl $7,_subtst");
602: dest = *p_destlb; /*init destination, source, & psw */
603: source = *p_sourcelb;
604: asm("movw _index,r10");
605: asm("bicpsw $PSWMASK");
606: asm("bispsw _flag_valuel[r10]");
607: /*execute cvt instruction */
608: asm("cvtlb _source,_dest+3"); /* memory to memory */
609: asm("movpsl _psw"); /*save psw */
610: psw &= FLAGS; /*mask out all bits except flag bits */
611: if (dest != *p_explb)
612: {
613: asm("movl $1,_ercode");
614: if (scoplp) longjmp();
615: error(dest,*p_explb,source,*p_destlb);
616: }
617: if (source != *p_sourcelb)
618: {
619: asm("movl $3,_ercode");
620: if (scoplp) longjmp();
621: error(source,*p_sourcelb,source,*p_destlb);
622: }
623: if (psw != *p_exp_pswl)
624: {
625: asm("movl $2,_ercode");
626: if (scoplp) longjmp();
627: error(psw,*p_exp_pswl,source,*p_destlb);
628: }
629: if (force_lp) longjmp();
630: else
631: return(0); /*no error exit*/
632: }
633: }
634:
635:
636:
637: static t_cvtlb1 () /*single test 1 called by main test*/
638: /*source location = destination location*/
639: {
640:
641: for ( ; ; )
642: {
643: /*initialize source, & psw */
644: setjmp();
645: asm("c8: movab c8,_stpc");
646: asm("movl $8,_subtst");
647: source = *p_sourcelb;
648: asm("movw _index,r10");
649: asm("movl _source,r5"); /* load first operand register */
650: asm("movl _source,r6"); /* load second operand register */
651: asm("bicpsw $PSWMASK");
652: asm("bispsw _flag_valuel[r10]");
653: /*execute cvt instruction */
654: asm("cvtlb r5,r6"); /* register to register */
655: asm("movpsl _psw"); /*save psw */
656: psw &= FLAGS; /*mask out all bits except flag bits */
657: asm("movb r6,_source+3"); /* load source location */
658: if (source != *p_explb)
659: {
660: asm("movl $1,_ercode");
661: if (scoplp) longjmp();
662: error(source,*p_explb,*p_sourcelb,*p_sourcelb);
663: }
664: if (psw != *p_exp_pswl)
665: {
666: asm("movl $2,_ercode");
667: if (scoplp) longjmp();
668: error(psw,*p_exp_pswl,*p_sourcelb,*p_sourcelb);
669: }
670: if (force_lp) longjmp();
671: else
672: return(0); /*no error exit*/
673: } /*end of for loop*/
674: } /*end of test*/
675:
676:
677:
678: static cvtlw() /* convert long to word */
679: {
680: asm("bicpsw $PSWMASK"); /*psw = 0*/
681: for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
682: {
683: t_cvtlw ();
684: t_cvtlw1(); /*one more test where */
685: /* dest address = source address */
686: }
687: }
688:
689: static t_cvtlw() /*single test called by main test*/
690: {
691: for ( ; ; )
692: {
693: setjmp();
694: asm("c9: movab c9,_stpc");
695: asm("movl $9,_subtst");
696: dest = *p_destlw; /*init destination, source, & psw */
697: source = *p_sourcelw;
698: asm("movw _index,r10");
699: asm("bicpsw $PSWMASK");
700: asm("bispsw _flag_valuel[r10]");
701: /*execute cvt instruction */
702: asm("cvtlw _source,_dest+2"); /* memory to memory */
703: asm("movpsl _psw"); /*save psw */
704: psw &= FLAGS; /*mask out all bits except flag bits */
705: if (dest != *p_explw)
706: {
707: asm("movl $1,_ercode");
708: if (scoplp) longjmp();
709: error(dest,*p_explw,source,*p_destlw);
710: }
711: if (source != *p_sourcelw)
712: {
713: asm("movl $3,_ercode");
714: if (scoplp) longjmp();
715: error(source,*p_sourcelw,source,*p_destlw);
716: }
717: if (psw != *p_exp_pswl)
718: {
719: asm("movl $2,_ercode");
720: if (scoplp) longjmp();
721: error(psw,*p_exp_pswl,source,*p_destlw);
722: }
723: if (force_lp) longjmp();
724: else
725: return(0); /*no error exit*/
726: }
727: }
728:
729:
730:
731: static t_cvtlw1 () /*single test 1 called by main test*/
732: /*source location = destination location*/
733: {
734:
735: for ( ; ; )
736: {
737: /*initialize source, & psw */
738: setjmp();
739: asm("c10: movab c10,_stpc");
740: asm("movl $0xa,_subtst");
741: source = *p_sourcelw;
742: asm("movw _index,r10");
743: asm("movl _source,r5"); /* load first operand register */
744: asm("movl _source,r6"); /* load second operand register */
745: asm("bicpsw $PSWMASK");
746: asm("bispsw _flag_valuel[r10]");
747: /*execute cvt instruction */
748: asm("cvtlw r5,r6"); /* register to register operation */
749: asm("movpsl _psw"); /*save psw */
750: psw &= FLAGS; /*mask out all bits except flag bits */
751: asm("movw r6,_source+2"); /* load source location */
752: if (source != *p_explw)
753: {
754: asm("movl $1,_ercode");
755: if (scoplp) longjmp();
756: error(source,*p_explw,*p_sourcelw,*p_sourcelw);
757: }
758: if (psw != *p_exp_pswl)
759: {
760: asm("movl $2,_ercode");
761: if (scoplp) longjmp();
762: error(psw,*p_exp_pswl,*p_sourcelw,*p_sourcelw);
763: }
764: if (force_lp) longjmp();
765: else
766: return(0); /*no error exit*/
767: }
768: }
769:
770:
771:
772: static cvtbl() /* convert byte to long test */
773: {
774: asm("bicpsw $PSWMASK"); /*psw = 0*/
775: for (init_ptr(), index = 0; index < MAX_PATTERNS; bump_ptr(), index++)
776: {
777: t_cvtbl ();
778: t_cvtbl1(); /*one more test where */
779: /* dest address = source address */
780: }
781: }
782:
783: static t_cvtbl() /*single test called by main test*/
784: {
785:
786: for ( ; ; )
787: {
788: setjmp();
789: asm("c11: movab c11,_stpc");
790: asm("movl $0xb,_subtst");
791: dest = *p_destb; /*initialize destination, source, & psw */
792: source = *p_sourceb;
793: asm("movw _index,r10");
794: asm("bicpsw $PSWMASK");
795: asm("bispsw _flag_valueb[r10]");
796: /*execute cvt instruction */
797: asm("cvtbl _source+3,_dest"); /* memory to memory */
798: asm("movpsl _psw"); /*save psw */
799: psw &= FLAGS; /*mask out all bits except flag bits */
800: if (dest != *p_expbl)
801: {
802: asm("movl $1,_ercode");
803: if (scoplp) longjmp();
804: error(dest,*p_expbl,source,*p_destb);
805: }
806: if (source != *p_sourceb)
807: {
808: asm("movl $3,_ercode");
809: if (scoplp) longjmp();
810: error(source,*p_sourceb,source,*p_destb);
811: }
812: if (psw != *p_exp_pswb)
813: {
814: asm("movl $2,_ercode");
815: if (scoplp) longjmp();
816: error(psw,*p_exp_pswb,source,*p_destb,*p_exp_pswb,psw);
817: }
818: if (force_lp) longjmp();
819: else
820: return(0); /*no error exit*/
821: }
822: }
823:
824:
825:
826: static t_cvtbl1 () /*single test 1 called by main test*/
827: /*source location = destination location*/
828: {
829:
830: for ( ; ; )
831: {
832: /*initialize source, & psw */
833: setjmp();
834: asm("c12: movab c12,_stpc");
835: asm("movl $0xc,_subtst");
836: source = *p_sourceb;
837: asm("movw _index,r10");
838: asm("movb _source+3,r5"); /* load first operand register */
839: asm("movl _source,r6"); /* load second operand register */
840: asm("bicpsw $PSWMASK");
841: asm("bispsw _flag_valueb[r10]");
842: /*execute cvt instruction */
843: asm("cvtbl r5,r6"); /* register to register operation */
844: asm("movpsl _psw"); /*save psw */
845: asm("movl r6,_source"); /* reload source register */
846: psw &= FLAGS; /*mask out all bits except flag bits */
847: if (source != *p_expbl)
848: {
849: asm("movl $1,_ercode");
850: if (scoplp) longjmp();
851: error(source,*p_expbl,*p_sourceb,*p_sourceb);
852: }
853: if (psw != *p_exp_pswb)
854: {
855: asm("movl $2,_ercode");
856: if (scoplp) longjmp();
857: error(psw,*p_exp_pswb,*p_sourceb,*p_sourceb);
858: }
859: if (force_lp) longjmp();
860: else
861: return(0); /*no error exit*/
862: } /*end of for loop*/
863: } /*end of test*/
864:
865:
866:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.