E2.11 Write an instruction sequence to add the two 8-bit numbers stored in progr
ID: 2268261 • Letter: E
Question
E2.11 Write an instruction sequence to add the two 8-bit numbers stored in program memory at 0x1000 and 0x1005 together and leave the sum in the data memory location at 0x2000. E2.12 Write an instruction sequence to swap the 16-bit value stored in data memory location at 0x2000-0x2001 with the 16-bit value stored in the data memory at 0x2020-0x2021 E2.13 Write an instruction sequence to subtract the value stored at data memory location 0x2000 from the sum of the values stored at data memory locations 0x2010 and 0x2011 and leave the difference in rO. E2.14 Write an instruction sequence to subtract the sum of data memory locations at Ox2000 and 0x2001 from the sum of the data memory locations at 0x2010 and 0x2011 and leave the difference at data memory location 0x2020. E2.15 Write an instruction sequence to add the 16-bit value stored at data memory locations 0x2000-0x2001 and the 16-bit value stored at program memory locations 0x2010-0x2011 andExplanation / Answer
solution for 2.11:
this code is used to read the data from the memory,and where thehe rtesult is stored at memory locations i.e shows in detailed in below code and that expansion
.data ;data section starts
var1 DW 1000H ; define first memory address
var2 DW 1005H ; define second memory address
dest1 DW 2000H ; define destination address
code ; code section starts
MOV AX, [var1] ; get the value stored at location defined in var1, store that in AX
MOV BX, [var2] ; get the value stored at location defined in var2, store that in BX
ADD AX, BX ; add the values and store in AX
MOV [dest1], AX ; store result at memory address defined in dest1
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.