0% found this document useful (0 votes)
2 views1 page

Exercise

The document contains exercises related to assembly programming, including data definitions for variables, memory addressing questions, arithmetic operations, and little endian conversion. It requires writing assembly code for variable declarations, determining memory addresses, performing arithmetic operations, and converting a hexadecimal value to little endian format. Each exercise focuses on different aspects of assembly language and memory management.

Uploaded by

wip.cleaner
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Exercise

The document contains exercises related to assembly programming, including data definitions for variables, memory addressing questions, arithmetic operations, and little endian conversion. It requires writing assembly code for variable declarations, determining memory addresses, performing arithmetic operations, and converting a hexadecimal value to little endian format. Each exercise focuses on different aspects of assembly language and memory management.

Uploaded by

wip.cleaner
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercises

Exercise 1: Data Definitions


Write assembly code to declare the following variables in the .data segment:

1. A 32-bit unsigned integer initialized to 12345678h.


2. A null-terminated string "Hello, Assembly!".
3. An array of 5 bytes initialized to 0.
4. A 16-bit signed integer initialized to -100.

Exercise 2: Memory Addressing


Assume the following data segment starts at address 0x0000:

Answer the following questions:


1. What is the address of variable A?
2. What is the address of character 'Z' in variable B?

Exercise 3: Arithmetic Operations


Given the following variables declared in the .data segment:

Write assembly instructions to perform the following operations:

1. Add val1 and val2, and store the result in result.


2. Subtract val2 from val1, and store the result in result.
3. Multiply val1 by 2, and store the result in result.
4. Divide val2 by 4, and store the quotient in result.

Exercise 4: Little Endian Conversion


Convert the following value into their Little Endian representation:

DWORD value: 9ABCDEF0h

You might also like