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
C
12
26
D
13
27
E
14
28
F
15
29
A binary with d bits corresponds with integer values between...
0 and 2^d-1 bits
30
1byte= .. bits
8 bits
31
2bytes =
Word (dw) 16bits
32
4bytes=
Double (dd) 32bits
33
8bytes =
Quad word (dq)
34
In binary, leftmost is 1 it's is
Negative, signed
35
Twos complement?
In binary, flip bits and add 1
36
Range of unsigned 1byte number
00-FF (0-254)
37
Binary subtraction
1-0=1 1-1=0 0-0=1
38
Charles Babbage made what?
Difference machine
39
Von-Neumann structure
CPU,memory,input/output system
40
1950, kilby and noice made
An integrated circuit
41
1948 Bardeen Brattain and Shockley made...
Transistors
42
1 kilobyte is
1024 bytes
43
1 megabyte is
220 bytes
44
1 gigabyte =
230 bytes
45
1 terabyte =
240 bytes
46
Fetch decode execute cycle
Fetches the next program instruction from memory, Decodes it, And the ALU executes the computation The new register value is stored in memory
47
Oppose and operands are
Opcode= what instruction computes Operands= the input to the computation
48
Compiler=> assembler => CPU
Compiler compiles high level code, Assembler create machine code
49
Resx does?
Resx are uninitialized data Ex: L20 resd 100 100 in initialized 2-byte words
50
``` Operands: Register Memory Immediate Implied ```
``` 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
Eax= Ax= Al/ah=
32 bits 16 bits 8bits
52
Unsigned can overflow
If result is negative or too big(has a carry)
53
Short jump
Within 128 bytes in memory
54
Near jump
Anywhere in segment, 4byte displacement
55
Shl,shr is for .... numbers
Unsigned
56
Sal,sar is for ....
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
Rol,ror
Rotate shifts
58
Rcl,rcr
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
AND
Only turns on (1) if double 1 Turn off bits
60
OR
Only turns off (0) if double 0 Turn on bits Put f in 000F00h where u want to turn but on
61
XOR
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
NOT
flips all of the bits
63
Decimal -> hex
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=77*16+5 77=4*16+13 4= 0*16+4 Hex answer= 4D5
64
Shifting to the left is the equivalent of....
Multiplying by 2