Lab 5 (1)

docx

School

University Of Arizona *

*We aren’t endorsed by this school

Course

471

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by ColonelPuppy3910

Report
Lab 5 (50 points) Data Definitions (10 points) Q1- Write a data section that contains a definition of each data type listed below. Initialize each variable to a value that is consistent with its data type. Data Type A variable L1, 1 byte, initialized to 2: Answer: L1 db 2 A variable L2, a word size, initialized to 2000 (decimal) Answer: L2 dw 2000 A variable L3, 1 byte, initialized to 110111 in binary Answer: L3 db 110111b A variable L4, 1 byte, initialized to BC in hex Answer: L4 db BCh A variable L5, double word, initialized to FFFF1C81 in hex Answer: L5 dd FFFF1C81h A variable L6, 1 byte, initialized to the ASCII code for “G” Answer: L6 db 'G' A null-terminated L7, initialized to “Hello World” Answer: L7 db "Hello World" ,0 A variable L8, has 1000 bytes. Each byte initialized to 2 Answer: L8 db 1000 DUP(2) Uninitialized Data Declaration (10 points) Q2- Write a (,bss) section that declare the following variables. Uninitialized variable R1, 1 byte Answer: R1 DB ? Uninitialized variable R2, a word size Answer: R2 DW ? Uninitialized variable R3, 1 byte
Answer: R3 DB ? Uninitialized variable R4, 1 byte Answer:R4 DB ? Uninitialized variable R5, double word Answer:R5 DD ? Uninitialized variable R6, 1 byte Answer: R6 DB ? Uninitialized null-terminated string R7 that could have up to 10 characters Answer: R7 DB 10 DUP(?) Uninitialized variable R8, has 1000 bytes Answer: R8 DB 1000 DUP(?) Q3- (10 points) What is the memory content for the following data section variables? L1 db AAh, BBh L2 dw CCDDh L3 db EEh, FFh L1 L2 L3 OAAh OBBh ODDh OCCh OEEh OFFh Q4- (10 points) What is the memory content for the following data section variables? Assume the memory start with “pixels” from the left side (8) pixels times 2 db 0EA x dd 00011000 00111000 00011001 11000100 blurb db “Good”, 0 buffer times 10 db 013h min dw -17 pixels 000 011 10 101 010 10 00 01 10 00 001 110 00 0001 1001 1100 0100 0100 1000 0110 1111 011 011 11 011 001 00 000 000 00 000 110 01 000 110 01 000 110 01 000 110 01 000 110 01 000 110 01 000 110 01 000 110 01 000 110 01 0001 1001 0 0 0 1 00011 001
1 0 0 1 Q5: (10 points) What is the memory content for the following data and (.bss) sections variables? section .data first db 00h, 4Fh, 12h, A4h second dw 165 section .bss third resb 3 first 00 4F 12 A4 A5 00 61 64 66
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help