ASM Final

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/40

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

41 Terms

1
New cards

When converting from floating point to binary decimal point ___.

You take the decimal and multiply it by 2, drop the whole number, and repeat until you get a remainder of 0. Drop the leading 1 on the mantissa.

2
New cards

When a floating point leads to an infinite decimal, the computer will ___.

Approximate

3
New cards

Mantissa

The actual number portion of scientific notation.

4
New cards

In a 32 bit scientific number, the exponent sign uses ___ bit(s).

1

5
New cards

In a 32 bit scientific number, the exponent uses ___ bit(s).

8

6
New cards

In a 32 bit scientific number, the mantissa uses ___ bit(s).

23

7
New cards

In a 32 bit scientific number, the mantissa’s sign will always be ___.

1

8
New cards

Floats are calculated using the FPU, which stands for ___.

Floating Point Unit

9
New cards

An ASM instruction will have an ___ in front of it to signify it is used with floating points.

F

10
New cards

There are ___ FPU registers.

8

11
New cards

___ loads a float onto the FPU stack.

fld [num]

12
New cards

fadd st0, st1 stores the result in ___.

st0

13
New cards

Before calling a subroutine, the caller should:

Save the contents of the caller-saved registers (EAX, ECX, EDX) to the stack.

14
New cards

Parameters should be pushed before a subroutine and in ___.

Reverse Order

15
New cards

Since the stack grows down, the last thing to be pushed onto the stack will always be the ___ address.

Lowest

16
New cards

After the subroutine returns, the caller should:

Remove the parameters from the stack.

17
New cards

The return value of a subroutine should always be stored in ___.

EAX

18
New cards

After the stack is restored, the caller should:

Pop the caller-saved registers off the stack.

19
New cards

At the beginning of a subroutine, the callee should:

Push the value of EBP onto the stack, then copy the value of ESP into EBP.

20
New cards

After pushing EBP, the callee should:

Make space on the stack by decrementing ESP. The amount depends on how many local variables are needed.

21
New cards

After allocating variable space, the callee should:

Push the values of callee-saved registers (EBX, EDI, ESI) to the stack.

22
New cards

Before returning from a subroutine, the callee should:

Restore callee-saved registers, move the value of EBP into ESP, and pop EBP off the stack.

23
New cards

An ASM subroutine should be initialized in ASM as:

GLOBAL functionName

24
New cards

An ASM subroutine should be initialized in C as:

void functionName(args);

25
New cards

GCC will align structs in memory in ___ increments.

Doubleword

26
New cards

Given the struct:

struct node{
	int id;
	char name[20];
	struct node *next;
}[FILL];

What command in [FILL] would keep it from being doubleword aligned in memory?

__attribute__((packed))

27
New cards

A shared ASM variable should be initialized in ASM as:

GLOBAL num

28
New cards

A shared ASM variable should be initialized in C as:

extern int num;

29
New cards

When using a C function or variable in ASM:

Nothing special needs to be done in C.

30
New cards

A shared C variable/function should be initialized in ASM as:

EXTERN name

31
New cards

AND 1111, 0010 = ___.

0010

32
New cards

OR 1010, 0001 = ___.

1011

33
New cards

XOR 1010, 1001 = ___.

0011

34
New cards

NOT 1010 = ___.

0101

35
New cards

SHL 00001101, 4 = ___.

11010000

36
New cards

SHR 10011000, 5 = ___.

00000100

37
New cards

Logical Shift

Shifts the bits in a given direction, disregarding the sign.

38
New cards

Arithmetic Shift

Shifts the bits in a given direction, keeps the sign.

39
New cards

Rotation

Bitshift, but wraps the bits around instead of discarding them.

40
New cards

ROL 10011011, 4 = ___.

10111001

41
New cards

ROR 10011011, 3 = ___.

01110011