|
|
Power 6/32 Unix version 1.2b
/* CLRW (clear word) test */ /*Test name = Clrw */ /*Description = */ /* This test checks "clrw" instruction to see that */ /* (1)destination is cleared to zero */ /* (2)Z flag is set to one */ /* (3)N and V flags are set to zero */ /* (4)C flag is set to 1. */ /* Register 1 (r1) & memory location tmloc(lebel) are used as */ /* destination. */ /* */ /* Constants definition */ /* */ .set IPL,8 .set HIGH,31 .set ZERO,0 .set ONES,0xffffffff .set N,8 .set Z,4 .set V,2 .set C,1 .set EXPL,0X00000000 .set EXPW,0x0000ffff .set EXPB,0xffffff00 .set PSWMASK,0x003f .globl _clr_w _clr_w: callf $4,_setjmp /* save context for error return */ movab _clr_w,_stpc /* save subtest starting address */ movl $1,_subtst /* subtest number */ movl $1,_no_opr /* number of operands in use */ movl $ONES,_opr /* first operand */ 0: movl $ONES,r3 /*set r3 to all bits ones */ bicpsw $PSWMASK /*disable overflow & other enable bits */ bispsw $(N|V) /*turn negetive, & overflow */ clrw r3 /*execute "clrw" */ bneq error1 /*error if Z = 0 */ blss error1 /*error if N = 1 */ bvs error1 /*error if V = 1 */ bcc error1 /*error if C did not remain 1 */ jmp 1f error1: movpsl _actual /* actual = psl MAYBE it is incorrect */ bbs $0,_scoplp,0b /* if set scope loop on error */ movl $2,_ercode /* error code flag failure */ jmp *badrtn 1: bicpsw $Z /*clear Z flag */ cmpl r3,$0 /*check r1 = expected value */ beql clrwm /*if no error continue */ bbs $0,_scoplp,0b /* if set scope loop on error */ movl $1,_ercode /* error code data miscompare */ movl r3,_actual /* actual data */ movl $0,_expected /* expected data */ jmp *badrtn /* */ /* Now repeat the above test with a memory location (tmloc). */ /* */ clrwm: bbs $0,_force_lp,0b /* if set loop on last subtest */ callf $4,_setjmp /* save context for error return */ c2: movab clrwm,_stpc /* save subtest starting address */ movl $2,_subtst /* subtest number */ 0: movl $ONES,tmloc /*set tmloc to all bits ones */ bicpsw $PSWMASK clrw tmloc /*execute "clrw" */ bneq error2 /*error if Z = 0 */ blss error2 /*error if N = 1 */ bvs error2 /*error if V = 1 */ bcc error2 /*error if C did not remain 1 */ jmp 1f error2: movpsl _actual /* actual = psl MAYBE it is incorrect */ bbs $0,_scoplp,0b /* if set scope loop on error */ movl $2,_ercode /* error code flag failure */ jmp *badrtn 1: bicpsw $Z /*clear Z flag */ cmpl tmloc,$EXPW /*check tmloc = expected value */ beql aldn /*if no error all done ! */ bbs $0,_scoplp,0b /* if set scope loop on error */ movl $1,_ercode /* error code data miscompare */ movl tmloc,_actual /* actual data */ movl $EXPW,_expected /* expected data */ jmp *badrtn /*after "clrw" instruction */ aldn: bbs $0,_force_lp,0b /* if set loop on last subtest */ jmp *return /* good, return to monitor */ /* */ /* Variables definition */ /* */ .align 2 tmloc: .long 0xffffffff /* end */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.