cs152 hw1

发布时间 2023-12-13 12:25:34作者: ijpq

problem1

How many bytes is the program? For the above x86 assembly code, how many bytes of instructions
need to be fetched if x = 0x01020304 and n = 5? Assuming 32-bit data values, how many
bytes of data memory need to be loaded? Stored?

the program is 7x2+1 bytes;
becasue n = 5, so the loop structure will executed entirely for 5 times, plus one test instruction and one jz instruction. therefore, 5 * 15 + 4 bytes need to be fetched;
0 bytes of data memory need to be loaded or stored.