Comsc 260 Test 1 Study Guide (2019)

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

All of the following are directives that were introduced in chapter 3 EXCEPT: A. .heap B. .model C .stack D. .386

A

Suppose a program has the following data segment: .data valA BYTE 1h valB BYTE 2h, 3h, 4h, 5h Which of the following mov instructions will store 4h in register al? A. mov al, [valA+3] B. mov al, [valA+2] C. mov al, [valA+12] D. mov al, [valA+8]

A

The _ file contains a copy of the program's source code, with line numbers, the numeric address of each instruction, the machine code bytes of each instruction (in hexadecimal), and a symbol table. A. Listing B. Object C. Executable D. Source

A

What are the three steps of the instruction execution cycle in the correct order? A) 1. Fetch 2. Decode 3. Execute B) 1. Decode 2. Fetch 3. Execute C) 1. Execute 2. Fetch 3. Decode D) 1. Fetch 2. Execute 3. Decode

A

What are the two steps to get the two's complement of a hexadecimal number? 1. For each hexadecimal symbol i, perform: _ 2. _ A) 1. flipped_hex[i] = 15 - hex[i] 2. Add 1 B) 1. flipped_hex[i] = hex[i] - 15 2. Subtract 1 C) 1. flipped_hex[i] = 15 - hex[i] 2. Subtract 1 D) 1. flipped_hex[i] = hex[i] - 15 2. Add 1

A

What is the largest UNsigned number that you can make with five (5) bits? A. 31 B. 15 C. 16 D. 32

A

When adding hexadecimal numbers together in a column, what two steps are performed if their sum is greater than 15? 1. What you put down in the column is calculated by the formula: _ 2. Carry a 1 over to the next column A. sum = sum mod 16 B. sum = 15 mod sum C. sum = sum mod 15 D. sum = 16 mod sum

A

Which of the following options below is the correct way to do a line return (new line) in x86 assembly language? A. line_return BYTE 0Dh, 0Ah B. line_return BYTE 0Ah, 0Ah C. line_return BYTE 0Ah, 0Dh D. line_return BYTE 0Dh, 0Dh

A

Which of the options below is the smallest SIGNED binary number that you can make with six (6) bits? A. 100000 B. 000000 C. 011111 D. 111111

A

Which register is used to store the address of the next instruction that will be executed? A. EIP B. EDI C. ESI D. EBP

A

X DWORD 12h, 34h, 56h, 78h, 9Ah, 0Bh, 0Ch, 0Dh, 0Eh, 0Fh How many bits is X? A. 320 B. 640 C. 160 D. 80

A

var1 BYTE 6 dup("COMSC260") How many bytes is var1? A. 48 B. 6 C. 96 D. 12

A

AB + CD What is the sum of the hexadecimal numbers shown above? A. F58 B. 178 C. 189 D. F79

B

All of the following are part of the CPU (Central Processing Unit) EXCEPT: A. Internal Clock B. Address Bus C. General Registers D. Control Unit

B

How many bits are in a byte? A. 32 B. 8 C. 64 D. 16

B

What are the two steps to get the two's complement of a binary number? 1. For each binary bit i, perform: _ 2. _ A) 1. flipped_bit[i] = 1 - bit[i] 2. Subtract 1 B) 1. flipped_bit[i] = 1 - bit[i] 2. Add 1 C) 1. flipped_bit[i] = bit[i] - 1 2. Subtract 1 D) 1. flipped_bit[i] = bit[i] - 1 2. Add 1

B

What is the largest SIGNED number that can be represented with 8 binary bits? A. 128 B. 127 C. 255 D. 256

B

What is the two's complement of the hexadecimal number 101101? A. 010010 B. EFEEFF C. EFEEFE D. 010011

B

When adding binary numbers together in a column, what two steps are performed if their sum is greater than 1? 1. What you put down in the column is calculated by the formula: _ 2. Carry a 1 over to the next column HINT: 1 + 1 = 10 1 + 1 + 1 = 11 A. sum = 2 mod sum B. sum = sum mod 2 C. sum = 1 mod sum D. sum = sum mod 1

B

Which of the following is the correct SIGNED hexadecimal representation of -6? A. F1A B. FFA C. 1FA D. 11A

B

Which of the following options below describes the correct algorithm for converting an UNsigned decimal number to binary? 1. Divide the number by 2 2. Calculate and store the quotient 3. Calculate and store the remainder 4. Set number = _ 5. If the _ is not equal to 0, go back to step 1, else go to step 6 6. The binary number is stored in the remainder A) 4. remainder 5. remainder B) 4. quotient 5. quotient C) 4. quotient 5. remainder D) 4. remainder 5. quotient

B

Which of the following options below will 1) Produce the largest sum AND 2) NOT produce a carry out of the MSB (most significant bit)? NOTE: Everything here is UNsigned HINT: How many bits are registers al and bl? A) mov al, 127 mov bl, 1 add al, bl B) mov al, 254 mov bl, 1 add al, bl C) mov al, 126 mov bl, 1 add al, bl D) mov al, 255 mov bl, 1 add al, bl

B

Which of the following options below will 1) Produce the largest sum AND 2) produce a carry out of the MSB (most significant bit)? NOTE: Everything here is UNsigned HINT: How many bits are registers al and bl? A) mov al, 254 mov bl, 1 add al, bl B) mov al, 255 mov bl, 1 add al, bl C) mov al, 127 mov bl, 1 add al, bl D) mov al, 126 mov bl, 1 add al, bl

B

Which of the options below is the smallest SIGNED hexadecimal number that you can make with two (2) hexadecimal symbols? A. 7F B. 80 C. FF D. 00

B

How many bits are stored in the AH register? A. 32 B. 16 C. 8 D. 64

C

In an x86 assembly program, single-line comments begin with what? A. // B. : C. ; D. /*

C

Suppose n = number of hexadecimal symbols. Which of the options below is the correct formula that will give you the largest UNsigned hexadecimal number that you can represent for a given number of hexadecimal symbols? A. 16^(n+1) + 1 B. 16^n + 1 C. 16^n - 1 D. 16^(n-1) - 1

C

Suppose we have the following x86 assembly program: L1: mov eax, 5 L2: mov ebx, 6 L3: add eax, ebx L1 is a what? A. instruction B. data label C. code label D. directive

C

The _ bus uses binary signals to synchronize the actions of all devices attached to the system bus. A. Address B. Data C. Control D. I/O

C

What are the three steps an assembly program goes through in the correct order? A) 1. Assemble 2. Execute 3. Link B) 1. Link 2. Assemble 3. Execute C) 1. Assemble 2. Link 3. Execute D) 1. Link 2. Execute 3. Assemble

C

What is the SIGNED binary number 10000000 converted to decimal? A. 256 B. -256 C. -128 D. 128

C

What is the SIGNED hexadecimal number 80 converted to decimal? A. 128 B. 256 C. -128 D. -256

C

Which of the following options below represents a 16 bit unsigned integer? A. QWORD B. DWORD C. WORD D. FWORD

C

Which of the options below is the largest SIGNED hexadecimal number that you can make with two (2) hexadecimal symbols A. 0F B. 8F C. 7F D. FF

C

X WORD 1A2Bh, 3C4Dh, 5E6Fh How is X stored in memory? A) 0000: B2 0001: A1 0002: D4 0003: C3 0004: F6 0005: E5 B) 0000: 6F 0001: 5E 0002: 4D 0003: 3C 0004: 2B 0005: 1A C) 0000: 2B 0001: 1A 0002: 4D 0003: 3C 0004: 6F 0005: 5E D) 0000: F6 0001: E5 0002: D4 0003: C3 0004: B2 0005: A1

C

_ ExitProcess, 0 notifies the operating system that the program has successfully finished in a 32-bit mode program. A. JMP B. CALL C. INVOKE D. RETURN

C

Suppose a program has the following memory layout: Relative Address 0000 0001 0002 0003 0004 0005 0006 0007 Value 'A' (ASCII code 41h) 'B' (ASCII code 42h) 'C' (ASCII code 43h) 'D' (ASCII code 44h) 'E' (ASCII code 45h) 'F' (ASCII code 46h) 'G' (ASCII code 47h) 'H' (ASCII code 48h) All of the following data segments would result in this memory layout EXCEPT: A) someval DWORD 44434241h WORD 4645h, 4847h B) Someval BYTE 41h, 42h WORD 4443h, 4645h, 4847h C) someval WORD 4241h, 4443h BYTE 45h, 46h, 47h, 48h D) someval WORD 4241h, 4443h DWORD 45464748h

D

Suppose n = number of bits. Which of the options below is the correct formula that will give you the largest UNsigned binary number that you can represent for a given number of bits? A. 2^n + 1 B. 2^(n-1) - 1 C. 2^(n+1) + 1 D. 2^n - 1

D

Suppose register al is initialized with the following binary value: mov al, 00000010b All of the options below will change the value in register al to binary00010000b EXCEPT: A) mov bl, 1 add al, bl add al, bl add al, bl add al, bl add al, bl add al, bl add al, al B) mov bl, 3 add al, bl add al, bl add al, bl add al, bl add al, 2 C) mov bl, 2 add al, bl add al, bl add al, bl add al, bl add al, bl add al, bl add al, bl D) mov bl, 4 add al, bl add al, bl add al, bl add al, bl

D

Suppose we want to represent the decimal number 19 as a SIGNED binary number using the least number of bits possible. Which of the options below is correct? A. 100011 B. 0100011 C. 10011 D. 010011

D

Suppose we want to represent the decimal number 65 as an UNsigned binary number using the least number of bits possible. Which of the options below is correct? A. 010000001 B. 01000001 C. 10000001 D. 1000001

D

The _ flag is set to 1 when the result of a SIGNED arithmetic operation cannot fit into the destination. A. Parity B. Auxiliary Carry C. Carry D. Overflow

D

Which of the following options below is the correct way to end a string with the null terminator character? A. Text BYTE "Hello World", "0" B. Text BYTE "Hello World", '0' C. Text BYTE "Hello World", [0] D. Text BYTE "Hello World", 0

D

Which register is the frame pointer? A. EDI B. ESP C. EIP D. EBP

D

Which register is used to keep track of loop iterations? A. EDX B. ESI C. EDI D. ECX

D

Which register is used to manage the runtime stack? A. EIP B. EDI C. ESI D. ESP

D

X DWORD 12h, 34h, 56h, 78h, 9Ah, 0Bh, 0Ch, 0Dh, 0Eh, 0Fh How many bits is X? A. 80 B. 640 C. 160 D. 320

D

X DWORD 87654321h How is X stored in memory? A) 0000: 78 0001: 56 0002: 34 0003: 12 B) 0000: 87 0001: 65 0002: 43 0003: 21 C) 0000: 12 0001: 34 0002: 56 0003: 78 D) 0000: 21 0001: 43 0002: 65 0003: 87

D

_ mode is useful if a program needs direct access to hardware devices. A. System Management B. Virtual 8086 C. Protected D. Real Address

D

mov al, FEh add al, 1 The add instruction will set _ A. overflow flag (OF) = 1 B. carry flag (CF) = 1 C. zero flag (ZF) = 1 D. sign flag (SF) = 1

D


Ensembles d'études connexes

Instrumental Conditioning: Foundations Chapter 5

View Set

Chapter 12 and 13 Microeconomics Final

View Set

Ch. 23 Disruptive Behavior Disorders M.C.

View Set

Chapter 12 Business Presentations

View Set