Midterm1 Flashcards

1
Q

What is a signed number

A

A negative number

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

When do u use imul, idiv

A

In negative numbers

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

Div edx,eax stores quotient and remainder where?

A

Quotient in eax

Remainder in edx

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

How to detect overflow in unsigned equations

A

Carry flag is set (Jc,jnc)

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

How to detect overflow in signed equations

A

Overflow flag is set (jo,Jno)

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

How to tell if CF is set?

A

1: hex addition, if last addition in equation has a carry

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

How to tell if OF is set?

A

Think of the two numbers as signed:
If they are a different sign then OF=0 no matter what

If they are the same sign, OF=1 only if the result of adding the two together makes no sense (sign+sign=unsign)

Ex. AF+84 = 33
Adding Two negative should not make it a positive

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

When moving a greater quantity to a smaller quantity the bits on what side are dropped?

A

Left

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

When increasing with movsx what happens?

A

Adds replicas of signed bit to the left

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

When increasing with movzx what happens?

A

Adds zeros to the left

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

What are jump instructions for unsigned numbers?

A

JE,JNE,JB,JNAE,JBE,JNA,JA,JNBE,JAE,JNB

B=below
A=above

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

Jump instructions for signed numbers

A

JE,JNE,JL,JNGE,JLE,JNG,JG,JNLE,JGE,JNL

G=greater
L=less

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

What is the memory layout in little endian?

A

If any memory that is not db, hex representation is stored backwards

Ex.
dd AABBCCAA

In register: AACCBBAA

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

Mov eax,L2

A

Will make the “pointer” point to the first byte of L2

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

Add eax,2

A

Will make the “pointer” move 2 bytes within the register

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

Mov word[eax], 23

A

Will save the hex value of 23 where ever the pointer is pointing too as 4bytes (because of word)

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

Adc al,0

A

Will make al+=0+carry

Basically will save 1 or 0 to determine with carry but was flipped on or off

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

What can xor be used for?

A

To flip a bit

Ex.

XOR eax,ebx

Will flip the bit in eax when ebx where ebx is pointing to

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

Octal/binary/hex -> decimal

A

base^n+……+#base^0=base decimal number

This goes for any bases
Binary (2), octal (8), hex(16)

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

Binary -> decimal

A

Only is there is a one, you add the the decimal representation together:

Ex: 1010
8+2=10

256 128 64 32 16 8 4 2 1

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

Binary arithmetic

A

1+1= 0 and a carry
0+0=0
1+0=1

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

Hex addition?

A

If overflows, start back from 10, result will be whatever u counted when I start back from 10 and a carry

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

A

A

10

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

B

A

11

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

C

A

12

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

D

A

13

27
Q

E

A

14

28
Q

F

A

15

29
Q

A binary with d bits corresponds with integer values between…

A

0 and 2^d-1 bits

30
Q

1byte= .. bits

A

8 bits

31
Q

2bytes =

A

Word (dw) 16bits

32
Q

4bytes=

A

Double (dd) 32bits

33
Q

8bytes =

A

Quad word (dq)

34
Q

In binary, leftmost is 1 it’s is

A

Negative, signed

35
Q

Twos complement?

A

In binary, flip bits and add 1

36
Q

Range of unsigned 1byte number

A

00-FF (0-254)

37
Q

Binary subtraction

A

1-0=1
1-1=0
0-0=1

38
Q

Charles Babbage made what?

A

Difference machine

39
Q

Von-Neumann structure

A

CPU,memory,input/output system

40
Q

1950, kilby and noice made

A

An integrated circuit

41
Q

1948 Bardeen Brattain and Shockley made…

A

Transistors

42
Q

1 kilobyte is

A

1024 bytes

43
Q

1 megabyte is

A

220 bytes

44
Q

1 gigabyte =

A

230 bytes

45
Q

1 terabyte =

A

240 bytes

46
Q

Fetch decode execute cycle

A

Fetches the next program instruction from memory,
Decodes it,
And the ALU executes the computation
The new register value is stored in memory

47
Q

Oppose and operands are

A

Opcode= what instruction computes

Operands= the input to the computation

48
Q

Compiler=> assembler => CPU

A

Compiler compiles high level code,

Assembler create machine code

49
Q

Resx does?

A

Resx are uninitialized data

Ex:

L20 resd 100

100 in initialized 2-byte words

50
Q
Operands:
Register
Memory
Immediate
Implied
A
Register : are registers
Memory : specifies an address in memory 
Immediate : a fixed number ex: add eax,2
Implied: not actually encoded in the instruction
Ex: inc eax (really means eax+1)
51
Q

Eax=
Ax=
Al/ah=

A

32 bits
16 bits
8bits

52
Q

Unsigned can overflow

A

If result is negative or too big(has a carry)

53
Q

Short jump

A

Within 128 bytes in memory

54
Q

Near jump

A

Anywhere in segment, 4byte displacement

55
Q

Shl,shr is for …. numbers

A

Unsigned

56
Q

Sal,sar is for ….

A

Signed numbers, new bits entering are copies of the sign bit
(Adds zero if bits added in on right,
Most likely adds 1s if bits entering from left)

57
Q

Rol,ror

A

Rotate shifts

58
Q

Rcl,rcr

A

The carry flag and the source are rotated as one quantity

Ex if have a 16 bit item it’s technically is a 17bit item

59
Q

AND

A

Only turns on (1) if double 1

Turn off bits

60
Q

OR

A

Only turns off (0) if double 0

Turn on bits

Put f in

000F00h where u want to turn but on

61
Q

XOR

A

Only turns on (1) if not double 0 or double 1

Flip bits

By using F at any place u want to flip the bits

62
Q

NOT

A

flips all of the bits

63
Q

Decimal -> hex

A

Decide decimal number by 16
Take answer and multiple 16, and then add the remainder

Repeat until 0

Remainders, in hex, will be answer

Ex:
1237=7716+5
77=4
16+13
4= 0*16+4

Hex answer= 4D5

64
Q

Shifting to the left is the equivalent of….

A

Multiplying by 2