Assembly Language Programming Test #1

Assembly Language Programming Test #1

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

Explain the concept of twos compliment and it's implication.

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (60)

Section 1

(50 cards)

Explain the concept of twos compliment and it's implication.

Front

1) Two's complement is used to get the negative of a number. 2) Take the opposite of all digits and add one to the least significant digit. Ex: 0111 = 7 Opposite: 1000 Add one: + 1 ————— 1001 = -7

Back

What does Big-O determine about a program?

Front

Describes the upper bound or worst-case on the algorithms performance

Back

Hardware: What does the graphics card do?

Front

Controls Graphics ()

Back

What are the steps of the instruction execution cycle?

Front

1) Fetch: Retrieve the instruction from memory. 2) Decode: Interprets what's the instruction is. 3) Fetch Operands: Is data is needed, get it 4) Execute: Run the instruction (preform operation) 5) Store: Store the result and update internal states

Back

What is used to go from Assembly language to Machine language?

Front

Assembler

Back

What does it mean to analyze an algorithm?

Front

1) How much time it will take 2) How many resources will it use? (Memory, communication, time)

Back

How is binary addition done?

Front

1) Adding a 0 + 1 will result in a one. 2) Adding a 1 + 1 will result in 2; so put a zero and carry the one over the next two numbers. 1 1 Ex: 0 1 1 0 6₁₀ + 0 0 1 1 Check: 3₁₀ —————- ———- 1 0 0 1 9₁₀

Back

In Big-O, do we study the algorithm or the implementation?

Front

Algorithm

Back

What are the 3 main steps of an Assembler?

Front

1) ASCII Source File 2) Assembler reads source file and produces object file 3) Linker checks libraries based on object file

Back

What is data stored as?

Front

Binary (001010101000011110)

Back

What are the different types of busses?

Front

1) Data bus 2) Control bus 3) Address

Back

Can you do the equation 1101.1001 = ?₁₀

Front

No, because 1101.1001 does not have a base

Back

Why should be learn Assembly Language?

Front

It gives us complete control over the computer

Back

How can we determine a computers speed?

Front

How fast a set of instructions run.

Back

Hardware: What does the motherboard do?

Front

Bridge that puts everything together

Back

for Signed binary numbers, how are they represented as positive or negative?

Front

1) If the most significant bit (the first integer) is 0, it's positive. 2) If the most significant bit (the first integer) is 1, it's negative.

Back

Is Assembly language "Portable"? (Can be written on one machine and run on another [ex: Windows to Mac]). Explain why or why not.

Front

No, it is not portable. It is not portable because of the 1-to-1 matching to the processors machine language.

Back

Hardware: What is memory, and what would happen if the power were to go out?

Front

Memory is volatile (temporary) storage. If the power goes out, it is gone.

Back

What factors affect a computers speed?

Front

1) High-level code 2) Compiler 3) Instruction set 4) Hardware speed

Back

How do you get from a Base 10 number to a base 2 number? Ex: 5₁₀ = ?₂

Front

Divide by 2 until the Quotient is Zero, while converting the remainders to binary. (Mult them by 2) Ex: 5/2 = 2.5 2/2 = 1.0 1/2 = 0.5☑️ Remainders: .5 * 2 = 1 .0 * 2 = 0 .5 * 2 = 1 Reverse them to get binary! 101 —> (Add Zero in front to get 4 bytes) 0101 ☑️

Back

What is Machine Language?

Front

A numeric language (binary or hexadecimal) understood by the processor.

Back

What does the control unit do?

Front

Controls the sequencing of steps involved in executing an instruction.

Back

What is the difference between a program and data?

Front

Program: A set of data that consists of a series of instructions to control the operation of a computer.

Back

What is the difference between Signed numbers and Unsigned numbers?

Front

Signed numbers can have a negative value. Unsigned are only positive (Including Zero)

Back

What does the Clock do?

Front

The clock synchronizes all the steps in the computer. Also known as the "heartbeat" of the computer

Back

Can different processors have different assembly languages?

Front

Yes they can.

Back

What is a Cache hit?

Front

when the CPU found the data/instruction cache

Back

How many clock cycles does a single read of memory take?

Front

4 cycles

Back

What is the ALU?

Front

The workhorse, does all of the calculations.

Back

What are the 4 parts of the CPU?

Front

1) Control Unit 2) Clock 3) Arithmic clock (ALU) 4) Register

Back

How is Hexadecimal addition done?

Front

Same as Binary addition, except taking letters into effect. A₁₆ + 3₁₆ —————— D₁₆

Back

What is Data?

Front

Quantities, characters or symbols on which operations can be performed by a computer or can be stored by the computer

Back

What is Assembly Language?

Front

the most basic programming language available for any processor.

Back

What is Big-Ω?

Front

Gives the lower band (it will run in at LEAST this time)

Back

What is a decision problem?

Front

A problem that will only yield a "yes" or "no"

Back

What is the base of hexadecimal?

Front

Base 16

Back

Hardware: What is the hard-drive, and what happens if the power goes out?

Front

The Hard-drive is long-term storage, and will remain even if the power goes out.

Back

Using Big-O notation: Size = N int foo (int * a, int size, int t) { for (int i=0; i<size; i++) { if (a[i] == t) return I; } return -1; }

Front

Answer: O(n) nothing is happening that makes it quadratic

Back

When determining Computability, what are the three main categories, as well as what they mean?

Front

1) Tractable (Solved in an efficient way) 2) Intractable (Can be solved, not efficiently) 3) Uncomputable (Cannot be computed)

Back

How do you convert an Unsigned Decimal to a Hexadecimal?

Front

1) Take the number that is Base 10 and divide it by 16 until the quotient is 0. Ex: 235/16 = 14.6875 14/16 = 0.875 0 ☑️ 2) Multiply the remainders by 16. if the number exceeds 9, convert it to its hexadecimal corespondent. Ex: Remainders: (.6875) * 16 = 11 = B (.875) * 16 = 14 = E 3) Reverse the remainders to get the answer. Ex: BE —> EB☑️

Back

How do you convert an Unsigned Hexadecimal to a decimal?

Front

1) Write the number in reverse order. Ex: ABC123 —> 321CBA 2) Convert the letter to its numerical value, if necessary. Ex: 3, 2, 1, 12, 11, 10 3) From left to right, multiply by 16 to the power of n + 1 (starting at zero). Ex: 3 (16^0) + 2 (16^1) + 1 (16^2) + 12 (16^3) ... + 10(16^5) 4) Add the result! Ex: 3 + 32 + 256 + 49,152 ... + 10,485,760 = Answer: 11256099☑️

Back

How do you convert an Unsigned Binary to Decimal?

Front

1) Reverse the binary number, putting the digit at the end first and so on. Ex: 0000.0001 —> 1000.0000 2) Multiply by 2 with an increasing exponent from 0. Add the products. Ex: 1 (2^0) + 0 (2^1) ... + 0 * (2^7). Answer: 1 ☑️

Back

What does the term "Instruction set" refer to?

Front

A program

Back

What is one difference between a 32-bit system and a 64-bit system?

Front

In a 32-bit, an Integer is 4 bytes. in a 64-bit, an Integer is 8 bytes

Back

What are the registers?

Front

High speed storage elements (faster than ram)

Back

What is a bus?

Front

A group of lines (connections) that serves as a connecting path for several devices.

Back

What is used to go from program language to assembly language?

Front

Compiler

Back

Hardware: What does the CPU do?

Front

Does the calculations (Brain of the Computer)

Back

What is the binary representation able? (In an 8 bit number, starting from __ and ending at __)

Front

| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 128 64 32 16 8 4 2 1

Back

What are the 16 Digits of a Hexadecimal?

Front

0-9 and A-F

Back

Section 2

(10 cards)

What are some types of status flags?

Front

1) Carry (CF) 2) Overflow (OF) 3) Sign (SF) 4) Zero (ZF) 5) Aux. Carry (AF)

Back

What is typically used when the value of the math equation is needed to keep its value in a 32-bit x86 processor?

Front

EBX

Back

What do we use for math in a 32-bit x86 processor?

Front

EAX

Back

What controls EAX, EBX, ECX, ESP, and ESI?

Front

ALU (does the calculations)

Back

A program is data. where do we store it and where do we run it from?

Front

Hard-disk to ram

Back

Cache is a special type of _______. why is it so expensive to make?

Front

Static Ram. it is expensive to make because it does not need to be refreshed.

Back

what is a Cache Miss?

Front

the CPU did not find the data/instruction in cache

Back

what is typically used for a loop counter in an 32-bit x86 processor?

Front

ECX

Back

What are the two types of flags?

Front

1) Control flags 2) Status flags

Back

What is typically the stack counter in a 32-bit x86 processor?

Front

ESP

Back