1 2.EXTERN MY_LABEL2; 3.section .text; 4 5// 6//8 BIT OPERATIONS 7// 8 9//BITCLR ( Dreg , uimm5 ) ; /* (a) */ 10BITCLR ( R7 , 0 ) ; 11BITCLR ( R7 , 31 ) ; 12BITCLR ( R7 , 15 ) ; 13BITCLR ( R1 , 0 ) ; 14BITCLR ( R2 , 1 ) ; 15BITCLR ( R3 , 19 ) ; 16 17//BITSET ( Dreg , uimm5 ) ; /* (a) */ 18BITSET ( R7 , 0 ) ; 19BITSET ( R7 , 31 ) ; 20BITSET ( R7 , 15 ) ; 21BITSET ( R1 , 0 ) ; 22BITSET ( R2 , 1 ) ; 23BITSET ( R3 , 19 ) ; 24 25//BITTGL ( Dreg , uimm5 ) ; /* (a) */ 26BITTGL ( R7 , 0 ) ; 27BITTGL ( R7 , 31 ) ; 28BITTGL ( R7 , 15 ) ; 29BITTGL ( R1 , 0 ) ; 30BITTGL ( R2 , 1 ) ; 31BITTGL ( R3 , 19 ) ; 32 33//CC = BITTST ( Dreg , uimm5 ) ; /* set CC if bit = 1 (a)*/ 34CC = BITTST ( R7 , 0 ) ; 35CC = BITTST ( R7 , 31 ) ; 36CC = BITTST ( R7 , 15 ) ; 37CC = BITTST ( R1 , 0 ) ; 38CC = BITTST ( R2 , 1 ) ; 39CC = BITTST ( R3 , 19 ) ; 40 41//CC = ! BITTST ( Dreg , uimm5 ) ; /* set CC if bit = 0 (a)*/ 42CC = !BITTST ( R7 , 0 ) ; 43CC = !BITTST ( R7 , 31 ) ; 44CC = !BITTST ( R7 , 15 ) ; 45CC = !BITTST ( R1 , 0 ) ; 46CC = !BITTST ( R2 , 1 ) ; 47CC = !BITTST ( R3 , 19 ) ; 48 49//Dreg = DEPOSIT ( Dreg, Dreg ) ; /* no extension (b) */ 50R7 = DEPOSIT(R0, R1); 51R7 = DEPOSIT(R7, R1); 52R7 = DEPOSIT(R7, R7); 53R1 = DEPOSIT(R0, R1); 54R2 = DEPOSIT(R7, R1); 55R3 = DEPOSIT(R7, R7); 56 57//Dreg = DEPOSIT ( Dreg, Dreg ) (X) ; /* sign-extended (b) */ 58R7 = DEPOSIT(R0, R1)(X); 59R7 = DEPOSIT(R7, R1)(X); 60R7 = DEPOSIT(R7, R7)(X); 61R1 = DEPOSIT(R0, R1)(X); 62R2 = DEPOSIT(R7, R1)(X); 63R3 = DEPOSIT(R7, R7)(X); 64 65//Dreg = EXTRACT ( Dreg, Dreg_lo ) (Z) ; /* zero-extended (b)*/ 66R7 = EXTRACT(R0, R1.L)(Z); 67R7 = EXTRACT(R7, R1.L)(Z); 68R7 = EXTRACT(R7, R7.L)(Z); 69R1 = EXTRACT(R0, R1.L)(Z); 70R2 = EXTRACT(R7, R1.L)(Z); 71R3 = EXTRACT(R7, R7.L)(Z); 72 73//Dreg = EXTRACT ( Dreg, Dreg_lo ) (X) ; /* sign-extended (b)*/ 74R7 = EXTRACT(R0, R1.L)(X); 75R7 = EXTRACT(R7, R1.L)(X); 76R7 = EXTRACT(R7, R7.L)(X); 77R1 = EXTRACT(R0, R1.L)(X); 78R2 = EXTRACT(R7, R1.L)(X); 79R3 = EXTRACT(R7, R7.L)(X); 80 81//BITMUX ( Dreg , Dreg , A0 ) (ASR) ; /* shift right, LSB is shifted out (b) */ 82BITMUX(R0, R1, A0)(ASR); 83BITMUX(R0, R2, A0)(ASR); 84BITMUX(R1, R3, A0)(ASR); 85//BITMUX(R0, R0, A0)(ASR); 86 87//BITMUX ( Dreg , Dreg , A0 ) (ASL) ; /* shift left, MSB is shifted out (b) */ 88//BITMUX(R0, R0, A0)(ASL); 89BITMUX(R0, R1, A0)(ASL); 90BITMUX(R1, R2, A0)(ASL); 91 92//Dreg_lo = ONES Dreg ; /* (b) */ 93R0.L = ONES R0; 94R0.L = ONES R1; 95R1.L = ONES R6; 96R2.L = ONES R7; 97 98 99