Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[Yasm] [ Ebe] The computation is done in Yasm using Ebe. If you any questions, please ask Here are the codes from Chapter 2 and
[Yasm] [ Ebe]
The computation is done in Yasm using Ebe. If you any questions, please ask
Here are the codes from Chapter 2 and Chapter 3. memory.asm and ch02.lst
Here are the examples from Chapter 3
The second laboratory exercise requires you to assign and transcribe different data types in yasmasm assembly language. Please create a file named memory.asm in EBE. Using the codes from Chapter 2 and 3, create a segment as .data in your file. Question 1- .data section. The first exercise requires you to code different numbers in the .data segment. There are generally four different types: db - byte (1 byte) dw - word (2 bytes) dd - double word (4 bytes) dq - quad word (8 bytes) The task is the following: 1. Choose an integer within this range [25, (27 1)]. Allocate this number using the three different types of db, dw and dd. Use labels a, b and c. 2. Choose a floating point number within this range [24, 26). Use at least three decimal points (non-zero values). Allocate this number using the dd type. Use label d. 3. Given the number 32452p, assign it using the minimum data type in base-16. Use label e. Question 2 - .bss section. The second exercise requires you to reserve different numbers in the .bss segment. 1. Reserve 10 words. Use label g. 2. Reserve an array of 50 bytes. Use label h. 3. Reserve an array of 15 double words. Use label i. Computation Use either the ebe interface or command line (makefile) to generate the machine code as memory.lst. In this file, you will have three fields (columns). The first columns is the mem- ory locations, the second columns is the values translated into base-16, however reversed. The third columns is the instructions itself. For each instruction in Question 1, convert the number into base-16 and verify it with col- umn 2. Save this computation in the file computation.doc. Please follow the example as in Chapter_3_example_03.pdf and show all working and explanation. Secondly, compute the memory displacement and verify it with column 1. Save this computa- tion in the file computation.doc. Please follow the example as in Chapter_3_example_03.pdf and show all working and explanation. Hat a X Command line hello.asm Downloads/CS311_Codes_Chapter3/CS311_Codes_Chapter3/memory.asm 1 2 3 a b 4 IU A OU U segment .data dd 4 dd 4.4 times 10 dd 0 dw 1, 2 db Oxfb db "hello world", 0 5 d ON Poo o o o e f g h i bis segment .bss resd 1 resd 10 resb 100 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 section .text global main ; let the linker know about main main: push mov sub rbp rbp, rsp rsp16 ; set up a strack frame for main ; let rbp point to the previous ssp ; leave some room for local variables ; and align stack to 16 byte boundary ; set rax to o for return value ; undo the stack manipulations , eax xor leave ret - cho2.Ist - Notepad File Edit Format View Help 620 621 622 623 624 625 626 627 628 1 2 00000000 00000000 3 00000004 0000803F 4 00000008 000080BF 5 0000000C 0000E03F 6 00000010 0000F542 7 00000014 00004401 8 00000018 0060F3C2 %endmacro %macro fpunalias 1-* %rep %0 %undef y%1 %undef x%1 %rotate 1 %endrep %endmacro segment .data dd 0.0 one dd 1.0 negi dd -1.0 a dd 1.75 b 122.5 d dd - 12.25 e dd - 121.6875 zero dd 0 Ln 1, Col 1 100% Windows (CRLF) UTF-8 Memory Example Mem Size Mem Translation Code 1 segment .data 2 00000000 04000000 a dd 4 3 00000004 CDCC8C40 b dd 4.4 4 00000008 00000000
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started