subject: computer arch and orgnization
1. Write ARM instructions to find the 1. 1's complement and 2's complement of a 32 bit number in location X and store the result in memory , Hi. I's complement and 2's complement of a 64-bit number in locations 'X' and 'X-1' (lower order first followed by higher order) and store the result in consecutive memory locations. LI's complement and 2's complement (32-bit) a) assume the location 'X' is 1000, and operand is C00000341 b) assume the output locations for I's complement and Z's complement of a 32 bit number are 7000 and 7004. Set pointer to data in memory. STORE DATA TO MEMORY MOV R1,0x1000 MOV RZ FOXC0000034 STR 2. R11 Load data into [RO). LDR RO.RU Complement the data and put it in RS). MVN RS.RO ADD R6, RS, HOO! Add i to data to generate 2's complement and store the result in (R53 Set base pointer to memory location 7000H MOV R7, Ox7000 Store CRS) in memory and increment pointer to next available memory. STR RS, R71, 004 Store (R6) in memory STR RS, R7] End END Page 1 of 3 TSN1101 - Computer Architecture and Organisation Lab 8-04 II. 1's complement and 2's complement (64-bit) Assume that X 6300H Input to program: If we want to find the 2's complement of the 64-bit number FFOO 0000 COOO 0034H, then (63001) = 0xC0000034 (lower order of the 64-bit number) (6304H) =0xFF000000 (higher order of the 64-bit number) Output of program: Assume result is stored in 6400H and 6408H (lower order followed by higher order) (6400H) 0xFFFFFCB (6404H) = 0x00FFFFFF (6408H)=0x3FFFFFCC (640CH) - OxO0FFFFFF 1. Write ARM instructions to find the 1. 1's complement and 2's complement of a 32 bit number in location X and store the result in memory , Hi. I's complement and 2's complement of a 64-bit number in locations 'X' and 'X-1' (lower order first followed by higher order) and store the result in consecutive memory locations. LI's complement and 2's complement (32-bit) a) assume the location 'X' is 1000, and operand is C00000341 b) assume the output locations for I's complement and Z's complement of a 32 bit number are 7000 and 7004. Set pointer to data in memory. STORE DATA TO MEMORY MOV R1,0x1000 MOV RZ FOXC0000034 STR 2. R11 Load data into [RO). LDR RO.RU Complement the data and put it in RS). MVN RS.RO ADD R6, RS, HOO! Add i to data to generate 2's complement and store the result in (R53 Set base pointer to memory location 7000H MOV R7, Ox7000 Store CRS) in memory and increment pointer to next available memory. STR RS, R71, 004 Store (R6) in memory STR RS, R7] End END Page 1 of 3 TSN1101 - Computer Architecture and Organisation Lab 8-04 II. 1's complement and 2's complement (64-bit) Assume that X 6300H Input to program: If we want to find the 2's complement of the 64-bit number FFOO 0000 COOO 0034H, then (63001) = 0xC0000034 (lower order of the 64-bit number) (6304H) =0xFF000000 (higher order of the 64-bit number) Output of program: Assume result is stored in 6400H and 6408H (lower order followed by higher order) (6400H) 0xFFFFFCB (6404H) = 0x00FFFFFF (6408H)=0x3FFFFFCC (640CH) - OxO0FFFFFF