quiz questions

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

What is the largest signed integer that may be stored in 32 bits?

(2^31) - 1 (wk1)

Which of the following defines an array local variable consisting of 50 signed words? LOCAL wArray:SWORD[50] LOCAL wArray[50]:SWORD LOCAL SWORD:wArray[50] LOCAL SWORD[50]:wArray

(wk4)

Convert the following binary number into a signed decimal value. 1100 1101 0011 1100

-12996 (with margin: 0) (wk2)

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

0 (wk3)

What is the value of the Carry flag after the following instructions? mov eax,12345h mov ebx,1000h mul eb

0(wk3)

After executing the following instruction sequence, what is the value of AL, in binary: mov al,11001111b and al,00101011b

0000 1011b (wk3)

After executing the following instruction sequence, what is the value of AL, in binary: mov al,4Bh and al,6Ch

0100 1000b

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

0Bh

After the following MASM code is executed: mov eax,19 mov ebx,3 mov edx,0 div ebx What is the value in the eax register (in decimal)? What is the value in the ebx register (in decimal)? What is the value in the edx register (in decimal)?

eax 6 ebx 3 edx 1

A procedure named midterm stored in memory at address F00Dh is about to be called. In the calling procedure, the address of the instruction immediately following the call to midterm is 9142h. After the statement call midterm is executed, eip contains F00Dh, esp contains 9142h, the top of the stack contains 7FFCh eip contains 8000h, esp contains 9142h, the top of the stack contains A000h

eip contains F00Dh, esp contains 8000h, the top of the stack contains 9142h (midterm)

MASM has built-in range checking for effective addresses.

false (Quiz 1)

List the three primary steps of the instruction execution cycle, in sequential order (even if some are missing).

fetch, decode, memory write

ESP always points to the ______ - the next, empty, location above the stack. -the beginning on the stack when your program fist began -last value to be added to, or pushed on, the top of stack. -the next, empty, location below the stack.

last value to be added to, or pushed on, the top of stack. (wk2)

The following is a valid data definition statement: str1 \ BYTE "This string is quite long!",0

true wk1

Is the expression X v (Y^Z) equivalent to (X v Z) ^(X v Y) right parenthesis for all possible inputs of X, Y, and Z?

true (wk1)

The MOVZX instruction is only used with unsigned integers.

true (wk2)

A doubleword (on x86 systems) is ___ bits.

wk1

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

xC6

is the following code valid .code mov eax,edx .data myByte BYTE 10 .code mov al,myByte

yes wk 1

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 in history? HISTLIMIT = 100 .data balance DWORD 0 account WORD ? history WORD HISTLIMIT DUP(?) isValid BYTE 0

0x110 (wk5)

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 in history? HISTLIMIT = 100 .data balance DWORD 0 account WORD ? history WORD HISTLIMIT DUP(?) isValid BYTE 0

0x4A (wk5)

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?

0xAB907856

Identify the sizes of the sign___ , exponent___ , and significand ___ for a Single Precision x86 floating point number.

1,8,23 (wk3)

Add the following two binary numbers and provide your answer as a string of 1's and 0's. Ignore the .0000 that Canvas adds. 0011110101 + 0101101110

1001100011 (with margin: 0)

Select the correct EVEN parity 12 bit Hamming code value for the unsigned integer value 178 1110 0111 0010 1010 0110 0010 0111 0111 0010 0011 0110 0010 1010 0111 0010 0111 0110 0010

1010 0111 0010 (wk3)

Given the following MASM code using Irvine's library: mov eax,1 mov ebx,4 label6: mul ebx call WriteDec call CrLf inc ebx cmp eax,40 jbe label6 mov eax,ebx call WriteDec call CrLf What number is printed on the third line of the output? (Ignore the .0000 that Canvas puts in there)

120 (Quiz 1)

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 91 bytes of memory. When implemented as a procedure, the procedure code requires 128 bytes (including parameter-passing, etc.), and each procedure call requires 13 bytes. How many bytes of memory will the entire program require if the new code is added as a procedure?

1633

Given the following MASM code using Irvine's library: mov eax,1 mov ebx,4 label6: mul ebx call WriteDec call CrLf inc ebx cmp eax,40 jbe label6 mov eax,ebx call WriteDec call CrLf What number is printed on the second line of the output? (Ignore the .0000 that Canvas puts in there)

20 (Quiz 1)

What is the maximum number of data bits you can encode with Hamming code using only 5 parity bits?

26 bits (midterm)

The code below uses the Space macro which simply displays the number of blank spaces specified by its argument. What is the first number printed to the screen after this code executes? (ignore the .0000 from Canvas) main PROC push 4 push 5 call rcrsn exit main ENDP rcrsn PROC push ebp mov ebp,esp mov eax,[ebp + 12] mov ebx,[ebp + 8] cmp eax,ebx jl recurse jmp quit recurse: inc eax push eax push ebx call rcrsn mov eax,[ebp + 12] call WriteDec Space 2 quit: pop ebp ret 8 rcrsn ENDP

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 31 times during the execution of a program. When implemented as a macro, the macro code requires 96 bytes of memory. When implemented as a procedure, the procedure code requires 108 bytes (including parameter-passing, etc.), and each procedure call requires 13 bytes. How many bytes of memory will the entire program require if the new code is added as a macro?

4000

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[14][1]? (in decimal - ignore the .0000 from Canvas)

564 (wk6)

After executing the following instruction sequence, what is the value of AL, in hexadecimal mov al,9Ch not al

63h (wk3)

Which letter choice shows the memory byte order, from low to high address, of the following data definition? BigVal DWORD 12345678h

78h,56h,34h,12h wk1

Suppose that you are given the following program. What decimal value does the AX register hold when someProcedure is called?? .data x DWORD 153461 y BYTE 37 z BYTE 90 .code main PROC mov AH, y mov AL, z call someProcedure inc EAX mov EBX, z xor EAX, EBX exit main ENDP END MAIN

9562 wk1

What hexadecimal number will ESP contain when the "mov eax,1" instruction is executed?

A40 (Q2)

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

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

Correct Answer 0x202C (midterm)

Convert the following binary number into a signed decimal value. 1010 0101 0110 0100

Correct Answers -23196 (with margin: 0) (wk2)

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

Correct Answers 1351256722 (wk4)

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

Correct Answers 43 6F 6D 70 75 74 65 72 (wk2)

he four-byte sequence 0x42 0x49 0x4E 0x00 stored in consecutive memory cells in a little-endian architecture represents ________________ (decimal) when interpreted as a 32-bit signed integer. (Ignore the .0000 that Canvas sticks on the end of the number).

Correct Answers 5130562 (with margin: 0) (midterm)

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 0010 1110 1101 0000 1110 1101 1000 1110 1001 0000 1110

Correct! 1101 0000 1110 (wk3)

Identify which of the following are correct formats for the DIV instruction. (Check all that apply) DIV imm16 DIV imm32 DIV reg, mem DIV mem16 DIV mem32 DIV reg, reg DIV reg DIV imm8 DIV mem8

DIV mem16 DIV mem32 DIV reg DIV mem8 (wk3)

After the following MASM code is executed: mov eax,96 mov ebx,13 mov edx,0 div ebx What is the value in the eax register (in decimal)? What is the value in the ebx register (in decimal)? What is the value in the edx register (in decimal)?

EAX 7 EBX 13 EDX 5 (Quiz 1)

The instructions used to manipulate the ESP regieter are (select all that apply): PUSH RET JNE CALL INC POP JMP DEC

PUSH POP RET CALL (wk2)

hich structure is the following true for? _________ have a calling mechanism involving the EIP.

Procedures

Which of the following are valid uses of the XCHG instruction? (check any/all that apply) XCHG reg,mem XCHG imm,reg XCHG reg,imm XCHG reg,reg XCHG mem,reg XCHG imm,reg XCHG mem,mem XCHG imm,imm

XCHG reg,mem XCHG reg,reg XCHG mem,reg (wk2)

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? What is the hexadecimal address of count?

You Answered 4E3A Correct Answer 4E37h (q2)

the four parts of a CPU are:

clock, registers, control unit, arithmetic logic unit

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

activation record

There are several important uses of runtime stacks in programs (select all that apply): A stack makes a convenient temporary save area for registers when they are used for more than one purpose. After they are modified, they can be restored to their original values. The stack provides temporary storage for local variables inside subroutines. When calling a subroutine, you pass input values called arguments by pushing them on the stack. When the CALL instruction executes, the CPU saves the current subroutine's return address on the stack.

all besides the first (Quiz 1)

Which of the following are true about assembly language instructions and directives? (select all that apply) an instruction is executed at assembly time an instruction is executed at runtime a directive is executed at assembly time a directive is executed at runtime

an instruction is executed at runtime a directive is executed at assembly time (wk1)

What is a single instruction that clears bits 0, 3, and 4 in the AL register? or al,00011001b or al,11110010b or al,11100110b and al,11100110b and al,11001110b and al,11100101b

and al,11100110b (wk3)

Values passed to a subroutine by a calling program are called _____.

arguments

Given the following register states, and using Indexed Addressing, which of the following lines of code will move the 11th element of the list array (of DWORDs) to the EAX register? EDX register contans the address of the first element of list. ESI register contains the address of the eleventh element of list. EBX register contains the value 40,

mov eax, list[ebx] (wk5)

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

on the stack (wk4)

The two's complement of an integer is formed by doing which of the following?

reversing (inverting) the bits and adding 1( wk1)


Conjuntos de estudio relacionados

The Secret to Happiness at Work Your job doesn't have to represent the most prestigious use of your potential. It just needs to be rewarding.

View Set

Legal Aspects of Real Estate Ch. 13; Fair Housing Laws

View Set

BJU Physical Science Chapter 12-21 (CCA Final Exam Review)

View Set

MKT Research and Analysis- Ch. 12

View Set

Aula 12 - A revolução druckeriana: os estudos sobre a gestão contemporânea e os novos desenhos organizacionais

View Set

Small Business Management - Chapter 7

View Set

Political Parties, Interest Groups, Media and Mexico Test Review

View Set

Unit 1 - Types and Characteristics of Equity Securities

View Set

ICS Final: Direct mail/ email marketing

View Set