ctle T.3 The imtruction set of the processor X Machine meoning ld addr.rval |75a
ID: 2267740 • Letter: C
Question
ctle T.3 The imtruction set of the processor X Machine meoning ld addr.rval |75aaxx|Lood the -bit vol (vol) into memory locoton ot add. id ptr,datal6 90 y Lood the 16-bit volue (datoté) Into the register ptr ld A.PEx and A,tval bne addr, offset 70 s ine addr dona sddr,offest os Decementthe cortents of memory lecotion at edde and branch # the resut hs not Lood the contents ofl memory locotion pointed to by ptr into A 54 xx Bronch to a location thot is offiet from the nest imtruction if the value at addr s zero Increment the cortarts of memory location addr 05 a Note aa: an 8-bit value thot represent on 8-bit address xxx i on 8-bit volue www a 16-bit value zzi distance of brand! from the first byte of the int uction after the branch intruction. Machine code are expressed in hex format. Assume we are using processor X above to execute the following code: Id 0x30, #10 Id prt, #0x1000 If the program is placed in the program memory staring at PC 1000 (address = 0x1000) memory staring at Addres Progrm Men 0x 1000 1O2 a. What are the contents of the program memory after executing the code? b. Write the values of the PC (address values) of the code in the program memory c. What is the value of register ptr after executing the code? 0 130Explanation / Answer
a). Contents of the program memory after executing the code
Memory location 0x30 contains 0x0A (Decimal 10) value after executing first instruction.
b). Values of the PC in the program memory
Intial value of PC = 0x1000
During first instruction execution, PC contains next address of the instructions to be executed, then PC = 0x1003
During second instruction execution, PC = 0x1006
c). Value of the ptr register = 0x1000
ld ptr,#0x1000; this instructiuon loads 16bit value 0x1000 into ptr register
Address Program Memory Instruction 0x1000 75 ld 0x30, #10 0x1001 30 0x1002 0A 0x1003 90 ld ptr, #0x1000 0x1004 10 0x1005 00 0x1006Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.