2450 - Machine Assembly (Ch. 3)

Provide examples of three different instruction mnemonics.

ADD, SUB, MOV

What is a calling convention, and how is it used in assembly language declarations?

A calling convention determines how parameters are passed to subroutines, and how the stack is restored after the subroutine call.

How do you reserve space for the stack in a program?

By subtracting a value from the stack pointer register

Explain why the term assembler language is not quite correct.

Assembler means the program that translate your source code. A more correct term is "assembly language

Explain the difference between big endian and little endian.

Little endian places the least significant bit in the lowest addressed position, on the right side the number. Big endian does the opposite.

Why might you use a symbolic constant rather than an integer literal in your code?

An integer literal, such as 48, has no direct meaning to someone reading the program's source code. Instead, a symbolic constant such as STUDENT_COUNT can be assigned an integer value ,and is self-documenting.

How is a source file different from a listing file?

A source file is given as input to the assembler. A listing file has additional text that will not assemble. It is a file that is created by the assembler and it is optionally generated.

How are data labels and code labels different?

Data labels exist in the data segment as variable offsets. Code labels are in the code segment, and are offsets for transfer of control instructions. A code label is followed by a colon, but a data label does not end with a colon.

T/F: An identifier cannot begin with a numeric digit

True

T/F: A hexadecimal literal may be written as 0x3A.

False, this notation is used in C, but not in assembly language.

Assembly language directives execute at runtime.

False

T/F: Assembly language directives can be written in an uppercase and lowercase letters

True

Name the four basic parts of an assembly language instruction.

Label, mnemonic, operand(s), comment

T/F: MOV is an example of an instruction mnemonic.

True

Show an example of a block comment.

Code example:
COMMENT /*
*/

Why is it not a good idea to use numeric addresses when writing instructions that access variables?

You do not use numeric addresses (offsets) for variables because the addresses would change if new variables were inserted before the existing ones.