please create a .lis, .o and .asm files Write an Intel x86 assembly language which makes use of the 2-D array trans- lation formula to access the array elements, making use of the register indirect addressing mode (or more specically \based-indexed addressing" which is just a variation of good ol' register indirect mode). Use the following .data section in your program: section .data ; put your data in this section using array db 3,2,4,1,5,6 ; we will assume that these 6 numbers represent ; a 2-d array of 3 rows and 2 columns ; ; 3 rows and 2 columns ; array = 3 2 ; 4 1 ; 5 6 Use one register to hold the starting address of the array, and use another register which holds the oset of the element. You may hardcode two registers to hold the row and column indices of the desired array element. For example: mov al, 1 ; al holds row index mov bl, 1 ; bl holds column index Load the desired array element into a register. Test your program using gdb for several typical values of row and column indices to ensure your program is working correctly. For the purposes of this lab, it is sucient to merely edit your source code and put new values into the row and column indices, re-assemble and re-run with gdb
Computer Science
please create a .lis, .o and .asm files
Write an Intel x86 assembly language which makes use of the 2-D array trans-
lation formula to access the array elements, making use of the register indirect
addressing mode (or more specically \based-indexed addressing" which is just
a variation of good ol' register indirect mode).
Use the following .data section in your
section .data
; put your data in this section using
array db 3,2,4,1,5,6
; we will assume that these 6 numbers represent
; a 2-d array of 3 rows and 2 columns
;
; 3 rows and 2 columns
; array = 3 2
; 4 1
; 5 6
Use one register to hold the starting address of the array, and use another
register which holds the oset of the element. You may hardcode two registers
to hold the row and column indices of the desired array element. For example:
mov al, 1 ; al holds row index
mov bl, 1 ; bl holds column index
Load the desired array element into a register. Test your program using gdb
for several typical values of row and column indices to ensure your program is
working correctly. For the purposes of this lab, it is sucient to merely edit your
source code and put new values into the row and column indices, re-assemble
and re-run with gdb.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images