Content

Exercise related to macros

Implement the macros described below and test them. For testing figure out some small and simple examples.

Some little helpers

We want to express some common operations more expressive:

Loading and storing a Quad-Word

Assume that n denotes some label. Write the macros ldq and stq that behave as follows:

Factorial

Write an assembly program that computes the factorial based on a for-loop

Vector-Sum

Write a assembly program that contains in the data segment:

When the program is finish the vector length should be overwritten with the sum of the elements.