Midterm 1

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Complete the following code: .data var1 byte ? var2 byte ? result byte ? .code main proc ; 1. read in two unsign numbers ; 2. save the numbers in var1 and var2 ; 3. calculate the following and save it in result. ; result = var1 * var2 + 7; ; ; 4. display the result to the console as a decimal number. exit main endp

.data var1 byte ? var2 byte ? result byte ? ; answer still pending for the MASM ;format

What will be printed out from the following code? .data list word 1, 2, 3, 4 .code main proc mov edx, offset list mov eax, [edx] call writeHex exit main endp end main

00 02 00 01

You are given a before condition of the registers eax, ecx and an instruction. Choose the correct after condition of eax Before condition: EAX: 01 23 45 67 ECX: 89 AB CD EF Instruction: sub al, cl After condition of EAX:

01 23 45 78

You are giving the before condition and an instruction. Give the after condition: Before: ecx: 0A 00 BF 7A instruction: neg ch After:

0A 00 41 7A

How many hex digits are there in a byte?

2

choose the right answer: You declared the following array in your data segment. var1 byte 20h, 8, 10h when you open the memory window, this is what you will see

20 08 10

Use the following data: dword1 DWORD 10000h,20000h,30000h,40000h Suppose we want EAX to contain the sum of the dword1 array when the following (incomplete) code finishes executing: 1: mov edi,OFFSET dword1 2: mov ecx,LENGTHOF dword1 3: ? 4: ? 5: ? 6: loop L1 Which of the following choices would best fill in lines 3, 4, and 5?

3: sub eax, eax 4: L1: add eax,[edi] 5: add edi,TYPE dword1

The hexadecimal value for the binary byte: 1000 1010, if it is signed Data is:

8A

You are given a before condition of the registers eax, ebx, edx and an instruction. Choose the correct after condition of eax, edx Before condition: EAX: 00 00 02 01 EBX: 00 00 00 11 EDX: FF 03 FF 01 Instruction: mul bl After condition:

EAX: 00 00 00 11 EDX: FF 03 FF 01

You are given a before condition of the registers eax, ebx, edx and an instruction. Choose the correct after condition of eax, edx Before condition: EAX: 00 00 00 0E EBX: 00 00 00 03 EDX FF FF FF 03 Instruction: div bl After condition:

EAX: 00 00 02 04 EDX: FF FF FF 03

You are given a before condition of the registers eax, ecx, edx and an instruction. Choose the correct after condition of eax, edx Before condition: EAX: 01 0F 00 0A ECX: 00 00 00 03 EDX: 0C E0 00 00 Instruction: div cx After condition:

EAX: 01 0F 00 03 EDX: 0C E0 00 01

You are given a before condition of the registers eax, edx and an instruction. Choose the correct after condition of eax, edx: Before condition: EAX: 12 34 56 78 EDX: 9A BC DE F0 Instruction: xchg al, dl After condition of EAX, EDX:

EAX: 12 34 56 F0 EDX: 9A BC DE 78

you are given a before condition of ecx register and an instruction. Choose the correct after condition of indicated flags: Before condition of ECX: FF FF FF FF Instruction: inc cl After condition of ecx:

FF FF FF 00

You are given a before condition of ecx register and an instruction. Choose the correct after condition of ecx: Before condition of ECX: 0A 00 BF 7A Instruction: mov ecx, -2 After condition of ECX:

FF FF FF FE

According to masm Assembler the following instruction is valid. mul 8

False

According to masm Assembler the following instruction is valid. xchg eax, dx

False

The binary representation of decimal -42 is 11010111.

False

The signed word with value 9FFH is a negative decimal value.

False

one way to translate an unsigned decimal integer into binary, repeatedly divide the integer by 16, saving each remainder as a binary digit.

False

A word (on x86 systems) is 16 bits (t/f)

True

The 8-bit two's complement of binary 10000010 is 01111110.

True

The hexadecimal representation of decimal 17 is 11h

True

The name of the lowest 16 bits of the EBX register is BX

True

The sum of the binary integers 0111 0111 and 0100 0100 is 1011 1011.

True

You are given a before condition of ecx register and an instruction. Choose the correct after condition of indicated flags: Before condition of ECX: FF FF FF C8 Instruction: add cl, 5 After condition:

ZF: 0 SF: 1 CF: 0 OF:0

Which of the following CALL instructions writes the contents of EAX to standard output as a signed decimal integer?

call WriteInt


Kaugnay na mga set ng pag-aaral

Clinical Anatomy Written Exam 1.

View Set

PA Drivers License Test Practice

View Set

VIP EEG Formulas for Duration/Frequency/Sensitivity/Voltage/Amplitude

View Set

Community Nursing HESI Practice EAQ's

View Set

All sample Questions 13A, 14, 15, 19, 13B, 14B, 16, 17

View Set

Tracy the Turtle- Unit 1 Computer science

View Set

Chapter 2: Stars and the Moon (RQs)

View Set