1 - How Assembly Language Works Flashcards

1
Q

What are assemblers?

A

An assembler is a utility program that converts source code programs from assembly language into machine language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are linkers?

A

A linker is a utility program that combines individual files created by an assembler into a single executable program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a debugger?

A

It lets you step through a program while it’s running and examine registers and memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a “one-to-many relationship”?

A

In a one-to-many relationship, a single statement expands into multiple assembly language or machine instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Give an example of an embedded systems application.

A

Automobile fuel and ignition systems, AC control, security, flight control, printers, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a device driver?

A

Device drivers are programs that translate general operating system commands into specific references to hardware details that only the manufacturer knows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Is there type checking on pointer variables in assembly language?

A

No, there is no type checking!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Translate the following to assembly language: X = (Y*4)+3

A
mov  eax, Y
mov  ebx, 4
imul  ebx
add  eax, 3
mov X, eax
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How is a computer made up of “virtual machines”?

A

Each layer represents a translation layer from a higher-level instruction set to a lower-level instruction set.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is a translated program often faster than an interpreted one?

A

Translated programs are coded in a language that can be directly executed, but interpreted programs must be translated while they are running.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Name the four virtual machine levels, from lowest to highest.

A
  1. Digital logic
  2. Instruction set architecture (ISA), or machine language
  3. Assembly language
  4. High-level language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why don’t programmers write applications in machine language?

A

Machine language provides no visual clues relating to the instruction syntax, so it is difficult to understand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you translate unsigned binary integers into decimal?

A

You just add up all the powers of 2 to the position values (right most 0, increasing to the left). For example, 00001001 is (2^3 + 2^0 ) = 9.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you translate unsigned decimal integers to binary?

A

Repeatedly divide the integer by 2, saving each remainder as a binary digit in reverse order.

For example, 9/2 is 4 with a remainder of 1, so put 1 at the right. Then 4/2 is 0, 2/2 is 0, and finally 1/2 is 0 with a remainder of 1, so put that on left. 9 becomes 1001.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you add binary digits?

A

You just add them like whole numbers, carrying the 1 (from 1+1 = 10) to the top of the next left column..

For example,
100
+ 1 1 1
= 1011.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the integer storage sizes for an x86 computers?

A
  1. byte (8 bits)
  2. word (16 bits)
  3. doubleword (32 bits)
  4. quadword (64 bits)
  5. doublequadword (128 bits)
17
Q

What are the large measurements of memory and disk space?

A
  1. kilobyte (2^10)
  2. megabyte (2^20)
  3. gigabyte (2^30)
  4. terabyte (2^40)
  5. petabyte (2^50)
  6. exabyte (2^60)
  7. zettabyte (2^70)
  8. yottabyte (2^80)
18
Q

How do you convert unsigned decimal to hexadecimal?

A

Repeatedly divide the decimal value by 16 an retain each remainder.

For example, 422/16 is 26 with R6, so put 6 on the right. 26/16 is 1 with RA, so put A on the right. 1/16 is 0 with R1, so put 1 on the left. This makes 1A6.

19
Q

How do you do hexadecimal addition?

A

The same as decimal addition, but you carry over 1 and subtract 16 from the current sum.

For example, 
  1
  6A2
\+49A
======
  B3C
20
Q

What are the signed binary integers?

A

For x86 processors, the MSB (most significant digit) is 0 when positive and 1 when negative.

e.g. 111101110 is negative and 00001010 is positive.

21
Q

What is two’s complement representation?

A

You can calculate how a negative number is represented by reversing all the bits and adding 1.

For example, if you start with 00000001, the reverse is 11111110, and if you add 1, you’d get 11111111, which represents -1 in decimal.

22
Q

How do you create the two’s complement of a hexadecimal integer?

A

You subtract each digit from 15 (F), then add 1. For example, 6A3D becomes 95C2, and adding one makes this 95C3.

23
Q

How do you convert a signed binary integer into decimal?

A

First, if it’s negative, use its two’s complement to find its positive equivalent. Then, just convert it normally.

For example, if you start with 11110000, you can reverse the bits to 00001111 and add 1 to get 00010000, which is 16. Therefore, the original was -16.

24
Q

How do you do binary subtraction?

A

Just like normal subtraction, with borrowing from the top digit to the left whenever it’s 0-1.

01101
-00111
————
00110

Alternatively, you could add the top with the two’s complement of the bottom, and then just ignore the leftmost carry.

25
Q

What is ASCII?

A

When characters used only 8 bits (e.g. MS DOS), a unit 7-bit integer is assigned to each character. The last digit can be used to make various characters (e.g. Greek characters).

26
Q

What is ANSI?

A

The American National Standards Institute that defines an 8-bit character set with up to 256 characters, 128 of which are standard on a U.S. keyboard (others are international).

27
Q

What is the Unicode standard?

A

A universal way of defining characters and symbols (internationally accepted “code points”).

UTF-8 is used in html, with the same byte values as ASCII.

UTF-16 is used in recent versions of Microsoft windows.

UTF-32 is when space is no concern, but for fixed-width characters.

28
Q

What are ASCII strings?

A

A succession of bytes containing ASCII codes.

29
Q

What are the ASCSII control characters?

A

Character codes 0-31 carry out predefined actions. For example, code 8 is backspace, 9 is tab, 10 is line feed, etc.

30
Q

What is operator precedence?

A

The NOT operator has the highest precedence, followed by AND and OR. However, you can use parenthesis to force precedence.