271

¡Supera tus tareas y exámenes ahora con Quizwiz!

A signed byte can be equal to

+127 (range is from -127 to +127)

myList SDWORD 500 DUP(-1) is correct syntax for declaring an array of 500 with all values incremented at...

-1

The four-byte sequence 0x92 0x8A 0x8A 0x92 stored in consecutive memory cells in a little-endian architecture represents ___________ (decimal) when interpreted as a 32-bit signed integer.

-1836414318

What is the value of the Overflow flag after the following instructions? mov eax,+4823424 mov ebx,-423 imul ebx

0

What is the value of the Overflow flag after the following instructions? mov al,-4 mov bl,4 imul bl

0

What is the value of the Overflow flag after the following instructions? mov ax,48 mov bx,4 imul bx

0

What is the integer range for standard ascii codes?

0 to 127

What are the values of the carry, zero, and sign flags after the following code executes: mov al,00110011b test al,2

0, 0, 0

What are the values of the carry, zero, and sign flags after the following code executes: mov al,6 cmp al,5

0, 0, 0

Select the correct EVEN parity 12 bit Hamming code value for the unsigned integer value 55

0001 0111 0111

4A2B is equivalent to what in binary?

0100 1010 0010 1011

7CBE is equivalent to what binary number?

0111 1100 1011 1110

What will be the hexadecimal value of AL after these instructions execute? mov al,0CFh and al,2Bh

0Bh

Mechanically speaking, the CALL procedure pushes its return address on the stack and

copies the called procedure's address into the instruction pointer.

~(X ⋀ Y) is true when x and y are

false

How is the two's complement of integers formed?

inverting (reversing) the digits and adding 1

Which procedure sets the zero flag if the AL register contains the ASCII code for a decimal digit

isDigit

A java virtual machine executes ___________ byte codes

java

The MOVSX instruction sign-extends an integer into a

larger operand

The USES operator, coupled with the PROC directive allows you to

list the names of all the registers modified within a procedure.

The formal name of the loop instruction is

loop according to ECX counter

2. For _________, arguments are substituted exactly as entered, without checking for memory, registers, or literals.

macros

3. For _________, the entire code is substituted for each call

macros

T/F Both procedures and macros may have parameters.

true

The carry flag is set when an ____________________ is too large to fit in a destination operand

unsigned integer

The MOVZX instruction is only used with

unsigned integers

A common programming error is to inadvertently initialize ECX to ____________ before beginning a loop

zero

Adding 5 to 0FBh in an 8-bit register sets what flag?

zero

The PUSH instruction decrements the stack pointer (by __ or __) and then copies over the operand into the stack at the location pointed to by the stack pointer.

2 or 4

How many bytes is a word?

2 bytes

ESP always points to

the last item that was added to (pushed on) the stack

18. Given the following array declaration: .data matrix DWORD 50 DUP(10 DUP(?)) If matrix[0][0] is the 0th sequentially stored BYTE in memory, which sequentially stored BYTE is the first byte corresponding to matrix[2][6]? (in decimal - ignore the .0000 from Canvas)

104

What is the value of the Carry flag after the following instructions? .data val1 WORD 2000h val2 WORD 0100h .code mov ax,val1 mul val2

1

What is the value of the Overflow flag after the following instructions? .data word1 SWORD 4 dword1 SDWORD 4 .code imul bx,word1,-16 imul ebx,dword1,-16 imul ebx,dword1,-2000000000

1

(1 + 4 / 2 + 1 + 2) * 3 / 2

1 4 2 / + 1 + 2 + 3 * 2 /

If a clock oscillates at 10 billion times per second it is_________________ for a clock cycle

1.0 x 10^-10

Suppose that each stage requires 2.8 nanoseconds to complete its task. How many nanoseconds would it take to complete 76 instructions without pipelining? Round your answer to the nearest integer.

1064 (76 * 2.8 * 5)

Select the correct ODD parity 12 bit Hamming code value for the unsigned integer value 55

1100 0110 0111

1101 0000 1100 is an ODD parity 12 bit Hamming code that contains a single-bit error. What is the corresponding uncorrupted Hamming code?

1101 0000 1110

For this problem, suppose that you are working with the partial data segment given below. Assume that the memory address of balance is 0x44. What hexadecimal address belongs to the last item inhistory? HISTLIMIT = 100 .data balance DWORD 0 account WORD ? history WORD HISTLIMIT DUP(?) isValid BYTE 0

110h

1100 0101 0110 is an ODD parity 12 bit Hamming code that contains a single-bit error. What is the corresponding uncorrupted Hamming code?

1110 0101 0110

7. Suppose that you are given the following partial data segment, which starts at address offset 0x1000 : .data idArray WORD 3546, 1534, 12, 3481, 154, 6423 x DWORD LENGTHOF idArray y DWORD SIZEOF idArray z DWORD TYPE idArray y contains what value, in decimal?

12

Hexadecimal digits can be used to represent how many binary digits?

12

The following instruction will increment the stack pointer (ESP) by how many bytes? ret 8

12 bytes

The following data segment starts at memory address 0x1200 (hexadecimal) .data printString BYTE "Assembly is fun",0 moreBytes BYTE 25 DUP(0) dateIssued DWORD ? dueDate DWORD ? elapsedTime WORD ? What is the hexadecimal address of dueDate?

122D

The four-byte sequence 0xC1 0xAC 0xDC 0x4B stored in consecutive memory cells in a little-endian architecture represents ___________ (decimal) when interpreted as a 32-bit signed integer.

1272753345

5. Suppose that a program's data and executable code require 1024 bytes of memory. A new section of code must be added; it will be used with various values 48 times during the execution of a program. When implemented as a macro, the macro code requires 89 bytes of memory. When implemented as a procedure, the procedure code requires 104 bytes (including parameter-passing, etc.), and each procedure call requires 5 bytes. How many bytes of memory will the entire program require if the new code is added as aprocedure?

1368

The four-byte sequence 0x8A 0x8B 0x8C 0x57 stored in consecutive memory cells in a little-endian architecture represents ___________ (decimal) when interpreted as a 32-bit signed integer

1468828554

How many bits are used by unicode characters in MS-Windows?

16 bits

What is the largest unsigned that can be stored in 24 bits?

16,777,215

Given the following array declaration: .data matrix DWORD 50 DUP(10 DUP(?)) If matrix[0][0] is the 0th sequentially stored BYTE in memory, which sequentially stored BYTE is the first byte corresponding to matrix[42][3]?

1692

The following data segment starts at memory address 0x1700 (hexadecimal) .data printString BYTE "Do not add decimal to hex",0 someBytes WORD 37 DUP(0) moreBytes BYTE 10, 20, 30, 40, 50, 60, 70, 80, 90 questionAddr DWORD ? ignoreMe WORD ?

176D

How many MB of memory can be accessed in real access mode?

1MB

8. Suppose that you are given the following partial data segment, which starts at address offset 0x1000 : .data idArray WORD 3546, 1534, 12, 3481, 154, 6423 x DWORD LENGTHOF idArray y DWORD SIZEOF idArray z DWORD TYPE idArray z contains what value, in decimal?

2

8. An algorithm takes 6.4 seconds to execute on a single 3.1 GHz processor. 24% of the algorithm is sequential. Assume that there is zero latency and that the remaining code exhibits perfect parallelism. How long (in seconds) should the algorithm take to execute on a parallel machine made of 7 3.1 GHz processors? Round answers to one decimal place.

2.2

In hexadecimal notation 33, 95, and and 257 are equal to what?

21 5F 101

9. Suppose that you are given the following program (with memory addresses shown on the left). What hexadecimal value does EIP hold immediately after "inc EAX" has executed? .data 0x100 x DWORD 153461 0x104 y BYTE 37 0x105 z BYTE 90 .code main PROC 0x12 push x 0x17 mov AH, y 0x1C mov AL, z 0x21 call someProcedure 0x26 inc EAX 0x2B mov EBX, z 0x30 xor EAX, EBX 0x35 exit main ENDP END MAIN

2B

The largest signed integer that can be stored in 32 bits is

2^31-1

A WORD is 2 bytes. How many offsets aways from the beginning will add 4 to the original value

3

How many versions does the MUL instruction come in?

3

3 3 * 5 4 2 * / -

3 * 3 - 5 / (4 * 2)

3 4 - 3 2 4 2 - + ^ -

3 - 4 - (3 ^ (2 + 4 - 2))

How many bits are a doubleword on an x86 processor?

32 bits

The four-byte sequence 0x2D 0xAC 0x52 0xCB stored in consecutive memory cells in a little-endian architecture represents ___________ (decimal) when interpreted as a 32-bit unsigned integer.

3411192877

Assume that your program has access to the following data segment (starting at address 0x310): .data id DWORD 7 matrix WORD 50 DUP(10 DUP(?)) What is the hexadecimal address of matrix[7][3] (the 4th element of the 8th row)?

3A6

the ret instruction without operands will return how many bytes off the stack?

4 bytes

4. Suppose that a program's data and executable code require 1024 bytes of memory. A new section of code must be added; it will be used with various values 37 times during the execution of a program. When implemented as a macro, the macro code requires 86 bytes of memory. When implemented as a procedure, the procedure code requires 162 bytes (including parameter-passing, etc.), and each procedure call requires 14 bytes. How many bytes of memory will the entire program require if the new code is added as a macro?

4206

Convert the following string into its ASCII hex representation. Don't use 0x or h with the hex values. The hex for "1+z" is 31 2B 7A Floating

46 6C 6F 61 74 69 6E 67

11. For this problem, suppose that you are working with the partial data segment given below. Assume that the memory address of balance is 0x44. What hexadecimal address belongs to the first item inhistory? HISTLIMIT = 100 .data balance DWORD 0 account WORD ? history WORD HISTLIMIT DUP(?) isValid BYTE 0

4A

Suppose that you are given the following MASM data segment declarations: .data idNumber BYTE ? status WORD 0 list DWORD 42 DUP(?) count DWORD ? The address of idNumber is 0x4E00. What is the hexadecimal address of the 14th element of list?

4E37

Suppose that you are given the following MASM data segment declarations: .data idNumber BYTE ? status WORD 0 list DWORD 42 DUP(?) count DWORD ? The address of idNumber is 0x4E00. What is the hexadecimal address of count?

4EAB

How many GB of memory can be accessed in protected mode?

4GB

(5 + 3) * 12 / (3 * 4) + 12

5 3 + 12 * 3 4 * / 12 +

The real8 directive is used when defining what?

64 bit IEEE reals

Suppose that each stage requires 6 nanoseconds to complete its task. How many nanoseconds will it take to complete 106 instructions with pipelining? Round your answer to the nearest integer.

660 .( 106 * 6 + 6 * 4) - where 4 is 5-1 from 4 more steps to complete the execution.

17. Given the following partial data segment, what value would I put in the brackets in list 8 to access the 18th element of list? (Ignore the .0000 that Canvas may append to your answer). .MAX = 50 .data list DWORD MAX DUP(0) a DWORD 25 b DWORD 15

68

The most significant bit in a binary byte is numbered bit

7

The four-byte sequence 0xC0 0xDC 0x8C 0x2B stored in consecutive memory cells in a little-endian architecture represents ___________ (decimal) when interpreted as a 32-bit signed integer

730651840

6. Suppose that you are given the following partial data segment: .data myPtrCheck BYTE 12h, 34h, 56h, 78h, 90h, ABh, CDh, EFh .code ... mov eax, DWORD PTR myPtrCheck EAX contains what value, in hexadecimal?

78653412

How many bytes is a quadword?

8 bytes

17. Given the following array declaration, how many bytes of memory does array matrix require? (in decimal - ignore the .0000 from Canvas) .data matrix WORD 19 DUP(25 DUP(?))

950

.data y BYTE 37 z BYTE 90 .code main PROC mov AH, y mov AL, z What value does the AX register hold?

9562

Suppose that you are given the following partial data segment: .data myPtrCheck BYTE 12h, 34h, 56h, 78h, 90h, ABh, CDh, EFh .code ... mov eax, DWORD PTR [myPtrCheck+2] EAX contains what value, in hexadecimal?

AB907856

Within the CPU, all calculations and logic operations take place inside the

ALU

What are the three most basic Boolean operators?

AND, OR, NOT

In what register will the quotient of the following instruction be found? DIV BX

AX

15. Which of the following is the correct addressing formula for matrix index M sub r, sub c?

Base Address + ElementSize [(r * #elements per row) + c]

Which answer choice shows the correct values of the Carry, Zero, and Sign flags after the following instructions execute? mov al,00110011b test al,2

CF = 0, ZF = 0, SF = 0

Which answer choice shows the correct values of the Carry, Zero, and Sign flags after the following instructions execute? mov al,6 cmp al,5

CF = 0, ZF = 0, SF = 0

What will be the final values of CX and DX when the following code executes? .data array SWORD 8,2,3,5,-4,6,0,4 .code mov cx,1 mov esi,2 mov ax,array[esi] mov bx,array[esi+4] cmp ax,3 jae L2 cmp bx,4 jb L1 jmp L3 L1: mov cx,4 L2: mov dx,5 jmp L4 L3: mov dx,6 L4:

CX = 1 DX = 6

What does the listing file do?

Contains a list of program symbols

After executing the following instruction sequence, what is the value of AL, in hexadecimal mov al,72h xor al,0A5h

D7

What is the name of the lower 8 bits of the EDX register?

DL

In what register will the remainder of the following instruction be found? DIV BX

DX

Which portions of a program can complicate the instruction-caching process?

Decision structures, Repetition, Recursion.

Which procedure displays the CPU flags and 32 bit registers

DumpRegs

In what register will the quotient of the following instruction be found? DIV EBX

EAX

The Loop counter is known as which register?

ECX

Storing a string byte using string primitives increments/decrements which register?

EDI

In what register will the remainder of the following instruction be found? DIV EBX

EDX

The RET instruction pops the top of the stack into what register?

EIP

Loading a string byte using string primitives increments or decrements which register?

ESI

Which register contains the starting address of data when calling DumpMem

ESI

Which registers are the extended index registers?

ESI and EDI

High-level languages always pass arrays to subroutines by value. True or False?

False

T/F MASM will throw an error when assembling the following data segment: .data myChecker BYTE 12h BYTE 34h BYTE 56h BYTE 78h BYTE 90h

False

T/F. Ret and ret 4 are the same.

False

T/F/ Assuming that all processor clock speeds are identical, executing a given software algorithm on a multicore processor is always faster than executing the same algorithm on a single-core processor.

False

T/FMost existing algorithms are already parallelizable.

False

The program counter is incremented during which command of the execution cycle?

Fetch

What are the three primary steps of the execution cycle?

Fetch, Decode, Execute

Which procedure returns the number of milliseconds elapsed since midnight.

GetMSeconds

Which procedure locates the cursor at a specific row and column on the screen.

Gotoxy

The Exit_Process does what?

Halts the program

A stack is a _________ structure

LIFO - Last In First Out

define an array local variable consisting of 50 signed words?

LOCAL wArray[50]:SWORD

Can an identifier begin with a digit?

No

Does MASM have built in range checking for effective addresses?

No

Is it ok to change the value of EBP inside a procedure?

No

Is AB62-$ a correct identifier?

No because of the -

Which offers a more flexible approach, passing arguments to procedures in registers, or on the stack?

On the stack

The ______ operator overrides the default type of a label (variable), and can also be used to combine elements of a smaller data type and move them into a larger operand.

PTR

The ______ operator returns a value that is equivalent to multiplying the number of elements in a single data declaration by the size, in bytes, of a single element of a data declaration.

SIZEOF

The area of the stack set aside for passed arguments, subroutine return address, local variables, and saved registers.

Stack Frame

After executing the following instruction sequence, what is the value of AL, in hexadecimal mov al,86h or al,42h

c6h

What are the 4 parts of the CPU?

System Clock, Arithmetic Logic Unit, Registers, Control Unit

The _________ operator returns the size, in bytes, of a single element of a data declaration.

TYPE

Which procedure advances the cursor to the beginning of the next line in the console window?

The CRLF procedure

Which bus uses electrical signals to synchronize the actions of all devices attached to the system bus?

The Control Bus

The name of the time delay in a CPU caused by differences between the speed of the CPU, the system bus, and the memory circuits is called

The Wait State

The stack frame inside a procedure is also known as...

The activation record

What are the two common types of stack parameters?

Value and reference parameters

Which instruction does the following statement apply? It decrements the stack pointer (by 2 or 4) and copies the operand into the stack at the location pointed to by the stack pointer.

The push instruction

An argument passed by reference consists of the offset of an object. True or False?

True

ArrayCount = ($ - newArray) /4 is correct when declaring an array that will automatically calculate the number of elements in the array. True or False?

True

By default, labels are only visible within the procedures they are declared. True or False?

True

List1 BYTE 10,20 and BYTE 30,40 are both syntactically correct. True or False?

True

Local variables are NOT created by adding a positive value to the stack pointer. True or False

True

T/F. Arrays are stored in contiguous memory.

True

T/F. The USES operator, coupled with the PROC directive, lets you list the names of all registers modified within a procedure

True

The ASCII codes for decimals are smaller than alphabetical characters? True or False?

True

The EQU directive does not permit a constant to be redefined at any point in a program. True or False?

True

True or False? X ⋁ Y is true when either X or Y is true

True

True or False? Device drivers nearly always have some code written in assembly language

True

True or False? X ⋁ (Y ⋀ Z) is equivalent to (X ⋀ Y) ⋁ (X ⋀ Z)

True

What general types of parameters are passed on the stack?

Value and reference arguments

Which procedure writes a single character output to standard output

WriteChar

Which procedure writes the contents of the EAX register as standard output as a single decimal integer.

WriteInt

If you reference a point beyond the end of an array in MASM (for example, the address of the what would be the 105th element of a 100-element array), what happens?

You attempt to access whatever data bytes are stored there.

High-speed memory that reduces the frequency of access by the CPU to conventional memory is called

cache memory

In the x86 Floating-Point, a decimal number contains three components:

a sign, a significand, and an exponent.

Creating a stack frame in order:

a. Passed arguments are pushed on the stack b. The subroutine is called, the subroutine return address is pushed on the stack c. As the subroutine begins to executre, EBP is pushed on the stack d. EBP is set equal to ESP, EBP acts as the base reference from this point on e. If there are local variable, ESP is decremented to save room f. If any registers need to be saved they are pushed on the stack

What advantages do stack parameters have over register parameters?

a. Stack parameters reduce code clutter because registers do not have to be saved and restored b. Stack parameters are compatible with high-level languages.

Another name for a stack frame is

activation record

Which action must take place inside a procedure to reserve space on the stack for two doubleword local variables?

after MOV EBP,ESP, subtract 8 from the stack pointer (ESP)

Before calling WriteDec, EAX contains

an integer

What is a single instruction that clears bits 0, 3, and 4 in the AL register?

and al,11100110b

Values passed to a subroutine by a calling program are called

arguments

1. One goal of multiple internal buses is to simplify what process?

bus arbitration

A program is considered portable if it can be run on

multiple platforms

If an integer's sign bit is 1 what sign is it?

negative

A _______________________ calls a procedure within a procedure

nested procedure

If loop sets ECX to zero, does a jump take place?

no

The assembler reads an assembly language source file and produces an

object file

Add notes on random range to note card

ok

Put indexed addressing and example on notes

ok

put FPU and infix examples on notes

ok

put base index addressing and example on notes

ok

study and give examples of AND, OR, XOR instructions

ok

study logic gates, put on notes with notation too

ok

5. Put register indirect addressing on notes with example

ok!

Adding 7Fh and 05h in an 8-bit register sets the

overflow flag

1. Which structure is the following true for? _________ have a return mechanism involving the system stack.

procedures

Which procedure generates a 32 bit pseudorandom integer in a specific range.

randomRange

Arrays are passed by ____ to avoid copying them onto the stack

reference

Passing by ______ requires popping a parameter's offset from the stack inside the called procedure.

reference

What are the valid XCHG commands?

reg, reg; reg, mem; mem, reg

What are the valid MOV instructions

reg, reg; reg, mem; mem,reg; reg,imm; mem,imm;

Operands may be any of the following

register name; constant or constant expression; variable name (memory)

An instruction is executed at _______________ but a directive is executed at ________________.

runtime, assembly time

the overflow bit is set when a _____________________ is too large to fit in a destination

signed integer

Even in older x86 processors, there was an ____________difference in performance between multiplication by bit shifting versus multiplication using the MUL and IMUL instructions.

significant

A subroutine's stack frame always contains the caller's return address and the

subroutine's local variables

Given list, an array of WORDs, what element is addressed by list[8]?

the 5th element


Conjuntos de estudio relacionados

Chapter 2 - Policy Standards for a Good Tax

View Set

Advantages of Social Media Marketing

View Set

What is the key to a successful referral program?

View Set

D. Omega-3 and Omega-6 Fatty acids

View Set

ECG CH 10 Pacemaker Rhythms and Bundle Branch Block (BBB)

View Set