Assembly Language Instructions

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which instruction is a general purpose instruction used to transfer byte or word from register to register, memory to register, or register to memory?

  • IN & OUT instructions
  • PUSH instruction
  • MOV instruction (correct)
  • POP instruction

Which of the following instructions is NOT used to transfer data?

  • PUSH
  • MOV
  • DAS (correct)
  • POP

The following instructions are used to perform rotate operations, EXCEPT:

  • ROL
  • ROR
  • REP
  • RCR (correct)

For the instruction MOV CL, CH, what is the code in the REG field when assembled?

<p>001 (A)</p> Signup and view all the answers

If the MOD field contains a 00, 01, or 10 and R/M Code is 001, what addressing mode is used?

<p>DS:[BX+DI] (B)</p> Signup and view all the answers

If the direction bit, D=1, data flows ________ the register REG field ________ the R/M field located in the second byte of an instruction.

<p>&quot;to, from&quot; (B)</p> Signup and view all the answers

If the instruction is MOV BL,DS:[1234H], what is the code for R/M?

<p>110 (D)</p> Signup and view all the answers

In a compare (CMP) operation, where is the result of comparison stored?

<p>nowhere (B)</p> Signup and view all the answers

In the RCL instruction, what happened to the destination operands functions?

<p>carry flag is pushed into LSB &amp; MSB is pushed into the carry flag (B)</p> Signup and view all the answers

Which is used to examine the state of individual bits, or groups of bits?

<p>Test (A)</p> Signup and view all the answers

Which selects the operation (addition, subtraction, move, and so on) that is performed by the microprocessor?

<p>Opcode (C)</p> Signup and view all the answers

Which flag acts as the Borrow flag in the instruction, SBB?

<p>carry flag (C)</p> Signup and view all the answers

What does the instruction MOV DS:[2000H], AL do?

<p>copies byte-size data in AX to the memory (D)</p> Signup and view all the answers

The instruction MOV [BP],DL will assemble with mm/mod=

<p>01 (C)</p> Signup and view all the answers

The instruction MOV BL,DS:[1234H] will assemble as a ________ instruction.

<p>4-byte (B)</p> Signup and view all the answers

The instruction, MOV AX, 1234H is an example of

<p>immediate addressing mode (D)</p> Signup and view all the answers

The instruction, MOV AX,[BX] is an example of

<p>register indirect addressing mode (C)</p> Signup and view all the answers

To compare the source and destination operands, what does CMP instruction performs between the operands?

<p>Subtraction (D)</p> Signup and view all the answers

What is the starting and ending address of the segment located by the segment register value, 1000H?

<p>&quot;10000H,1FFFFH&quot; (B)</p> Signup and view all the answers

Which of the following segment:offset combinations points to a common physical memory address? a) A1B2:000C, b) A1B0:200C, c) A1B0:002C, d) A1B1:001C

<p>&quot;a, c and d&quot; (B)</p> Signup and view all the answers

32-bit microprocessors operating in protected mode could address up to ________ of memory.

<p>4GB (B)</p> Signup and view all the answers

80286 could be operated in protected mode but with only have ________ for address bus.

<p>24-bit (B)</p> Signup and view all the answers

Given the following, what is the content of the destination after executing the instructions: MOV AX, 0FEEDh AND AX, 0F00Dh

<p>AX = F00Dh (C)</p> Signup and view all the answers

Given the following, what is the content of the register after executing the instruction: MOV AX, 11001100b XOR AX, 0CH

<p>AX = 000Ch (A)</p> Signup and view all the answers

One must never use the segment registers as data registers to hold arbitrary values because:

<p>They should only contain segment addresses (C)</p> Signup and view all the answers

The 100010dw mmregr/m template should be used for converting the following assembly instructions to machine code EXCEPT:

<p>&quot;MOV ES, AX &quot; (B)</p> Signup and view all the answers

The instruction that performs logical AND operation and the result of the operation is not stored in the destination operand.

<p>TEST (D)</p> Signup and view all the answers

This instruction inverts the carry flag.

<p>CMC (A)</p> Signup and view all the answers

This group of instruction is used to shift or rotate bits left or right in register or memory operands.

<p>Bit Manipulation Instructions (A)</p> Signup and view all the answers

Determine the data after executing each instruction. C=1 AL=1010 1011 RCR AL, 5

<p>BD (B)</p> Signup and view all the answers

Determine the data after executing each instruction. C=0 AL=1100 0111 ROL AL, 2

<p>1F (B)</p> Signup and view all the answers

Determine the data after executing each instruction. C=0 AL=0100 1101 SAR AL, 4

<p>04 (C)</p> Signup and view all the answers

Determine the data after executing each instruction C=1 AL=0011 1011 SHL AL, 3

<p>D8 (D)</p> Signup and view all the answers

Which mnemonic rotates left with carry the low count register content, twenty times?

<p>RCL CL, 20 (B)</p> Signup and view all the answers

Which mnemonic logically adds the content of data register and the data contained at the memory location addressed by 0919h and the segment register, DS. The answer is stored at the data register.

<p>OR DX, DS:[0919H] (C)</p> Signup and view all the answers

Which mnemonic jumps to a memory location labeled as ANGAT after performing addition, and there is a carry.

<p>JC ANGAT (B)</p> Signup and view all the answers

Which mnemonic instruction immediately adds the data valued 0919H with the accumulator and the carry?

<p>ADC AX, 0919H (A)</p> Signup and view all the answers

This mnemonic instruction adds one to the content of a memory location whose offset addresses are from base index register and source index register.

<p>INC ES:[BX+SI] (C)</p> Signup and view all the answers

Determine the data after executing the instruction. RCR AL, 5. Given C=1 and AL=1011 1001.

<p>AL=9DH (B)</p> Signup and view all the answers

Flashcards

MOV Instruction

Transfers byte or word from register to register, memory to register, register to memory or with immediate addressing.

Program control transfer instructions

Instructions for the transfer of data from memory to internal register, from internal register to memory, from one register to another register, etc.

ROL, ROR, and RCR

These instructions are used to perform rotate operations, except REP instruction.

DAS instruction

Not a data copy/transfer function. It is Decrement and Adjust

Signup and view all the flashcards

Assembler

A utility program that converts source code programs from assembly language into machine language.

Signup and view all the flashcards

Memory Location Calculation

2008CH is the physical memory location accessed for the next instruction if CS contains 2001H and IP contains 007CH.

Signup and view all the flashcards

MOV CL, CH Code

For the instruction MOV CL, CH, the code in the REG field when assembled is 001

Signup and view all the flashcards

Memory Address Given CS and IP

21000H is memory address of the next instruction if CS = 2000H and IP= 1000H.

Signup and view all the flashcards

MOV [SI], BH

Writes byte of data from BH into memory location 1000H

Signup and view all the flashcards

Segment End Address Calculation

242FFFFFH is where the described segment ends.

Signup and view all the flashcards

Addressing Mode

DS:[BX+DI] is the addressing mode when the MOD field contains a 00, 01, or 10 and R/M Code is 001.

Signup and view all the flashcards

Direction Bit D=1

Data flow 'to, from' the register REG field to/from the R/M field.

Signup and view all the flashcards

MOV BL,DS:[1234H] instruction

If the instruction is MOV BL,DS:[1234H], the code for R/M is indeterminate,

Signup and view all the flashcards

MOV CL,DS:[1234H]

00

Signup and view all the flashcards

CMP result stored

Nowhere

Signup and view all the flashcards

Selector Value EXCEPT

Ending address

Signup and view all the flashcards

Protected mode

Both a and b

Signup and view all the flashcards

Segment access IF

Both a and b

Signup and view all the flashcards

Real mode address

OCFF0H

Signup and view all the flashcards

RCL Instruction Function

Carry flag is pushed into LSB & MSB is pushed into the carry flag.

Signup and view all the flashcards

Bit Testing

Test instruction tests the state of individual bits, or groups of bits.

Signup and view all the flashcards

Operation Selector

Opcode selects operation performed by the microprocessor.

Signup and view all the flashcards

SBB Borrow Flag

Carry flag acts as Borrow flag in the SBB instruction.

Signup and view all the flashcards

MOV DS:[2000H], AL

The instruction MOV DS:[2000H], AL copies byte-size data in AX to the memory.

Signup and view all the flashcards

MOV [BP], DL

The instruction MOV [BP],DL will assemble with mm/mod=01.

Signup and view all the flashcards

MOV BL,DS:[1234H] length

The instruction MOV BL,DS:[1234H] will assemble as a 4-byte instruction.

Signup and view all the flashcards

Immediate Addressing Mode

The instruction, MOV AX, 1234H is a immediate addressing mode.

Signup and view all the flashcards

Register Indirect Addressing Mode

The instruction, MOV AX,[BX] is an example of register indirect addressing mode.

Signup and view all the flashcards

CMP instruction.

Subtraction.

Signup and view all the flashcards

Segment Starting and Ending Address

10000H,1FFFFH is the starting and ending address of the segment located by the segment register value, 1000H.

Signup and view all the flashcards

Segment-offset

"a, c and d"

Signup and view all the flashcards

Protected Mode Addressing

32-bit microprocessors can address up to 4GB in protected mode.

Signup and view all the flashcards

80286 Protected Mode

80286 could be operated in protected mode but with only 24-bit for address bus.

Signup and view all the flashcards

ADC BX,DX

ADC BX,DX Machine code (Hexadecimal): 13DA

Signup and view all the flashcards

AND AL,0FCH Machine

AND AL,0FCH Machine code (Hexadecimal): 24FC

Signup and view all the flashcards

POP BP.

POP BP, Machine code (Hexadecimal): 5D

Signup and view all the flashcards

Machine Code: 8CD0H.

Machine code 8CD0H is equal to MOV AX,SS

Signup and view all the flashcards

Execution gives ZF

False.

Signup and view all the flashcards

MOV AX instruction

AX = F00Dh is content of the destination after executing the MOV AX, OFEEDh AND AX, 0F00Dh.

Signup and view all the flashcards

XOR AX result

AX = 000Ch is content of the register after executing the instructions MOV AX, 11001100b XOR AX, 0CH

Signup and view all the flashcards

Jump Target

In calculating jump target address, displacement added to IP contents.

Signup and view all the flashcards

Study Notes

  • MOV is a general purpose instruction which transfers a byte or word:
  • From register to register
  • Memory to register
  • Register to memory
  • With immediate addressing
  • IN and OUT instructions, PUSH and POP instructions are not general purpose instructions

True/False

  • Program control transfer instructions transfer data:
  • From memory to internal register
  • From internal register to memory
  • From one register to another register
  • From input port to internal register
  • From internal register to output port

Multiple Choice

  • The REP instruction is not used to perform rotate operations; ROL, ROR, and RCR are used for rotate operations
  • DAS instruction is not a data copy/transfer function but MOV, PUSH, and POP are
  • If CS contains 2001H and IP contains 007CH, the physical memory location accessed for the next instruction is 2008CH.
  • For the instruction MOV CL, CH, the code in the REG field when assembled is 001
  • Given CS = 2000H and IP= 1000H, the memory address of the next instruction executed by the microprocessor is 21000H
  • If SI = 1000H, MOV [SI], BH writes a byte of data from BH into memory location 1000H
  • If a descriptor has Base = 23000000H, Limit = 012FFH and G =1, the described segment ends at 242FFFFFH
  • If the MOD field contains a 00, 01, or 10 and R/M Code is 001, the addressing mode is DS:[BX+DI]
  • If the direction bit, D=1, data flows "to, from" the register REG field - the R/M field located in the second byte of an instruction
  • If the instruction is MOV BL,DS:[1234H], the code for R/M = 110
  • If the instruction is MOV CL,DS:[1234H], the code for mm = 00
  • In a compare (CMP) operation, the result of comparison is stored nowhere
  • In protected mode, a selector value gives the following segment information EXCEPT ending address
  • In protected mode memory, protection implemented by restricting access to memory segments through both privilege levels and access rights
  • In protected mode, access to the segment is allowed if both RPL = DPL and RPL > DPL
  • In real mode, the physical address accessed by the segment-offset combination 0CD1:02E0 is 0CFf0H
  • In the RCL instruction, the carry flag is pushed into LSB & MSB is pushed into the carry flag
  • Test is a mnemonic that is used to examine the state of individual bits, or groups of bits
  • Opcodes selects the operation (addition, subtraction, move, and so on) performed by the microprocessor
  • The carry flag acts as the Borrow flag in the instruction, SBB
  • The instruction MOV DS:[2000H], AL copies byte-size data in AX to the memory
  • The instruction MOV [BP],DL will assemble with a mm/mod of 01.
  • The instruction MOV BL,DS:[1234H] will assemble as a 4-byte instruction
  • The instruction, MOV AX, 1234H is an example of immediate addressing mode
  • The instruction, MOV AX,[BX] is an example of register indirect addressing mode
  • To compare the source and destination operands, the CMP instruction performs subtraction between the operands.
  • The starting and ending address of the segment located by the segment register value, 1000H is "10000H,1FFFFH"
  • The segment:offset combination that points to a common physical memory address are "a, c, and d"
  • 32-bit microprocessors operating in protected mode could address up to 4GB of memory
  • The 80286 could be operated in protected mode but with only a 24-bit address bus

Fill in the Blank

  • Is a utility program that converts source code programs from assembly language into machine language: Assembler
  • The machine code for the instruction ADC BX,DX is 13DA in Hexadecimal.
  • The machine code for the instruction AND AL,0FCH is 24FC in Hexadecimal.
  • The machine code for the instruction POP BP is 5D in Hexadecimal
  • The assembly language for the machine code 8CD0H is MOV AX,SS
  • Given the instruction MOV BL,04Fh, adding the instruction ADD BL, 0B1H will yield ZF=0 results in False
  • Given the following instructions,
  • MOV AX, 0FEEDh
  • AND AX, 0F00Dh
  • The content of the destination after executing the instructions gives content: AX = F00Dh
  • Given the following instructions,
  • MOV AX, 11001100b
  • XOR AX, 0CH
  • The content of the destination after executing the instructions gives content: AX = 000Ch
  • In calculating the target address to jump to, a displacement is added to the contents of the register IP
  • In unsigned division of a doubleword in DX AX by a word in CX, the quotient is placed in AX and the remainder is in DX
  • In unsigned division of a word in AX by a byte in DATA2, the quotient is AL and the remainder is AH
  • In unsigned multiplication of AX with BX, the product will be placed in register(s) DX;AX

True/False

  • In unsigned multiplication of CX with a byte in AL, the product is not placed in both AX and DX registers but only in DX.

Multiple Choice

  • One must never use the segment registers as data registers to hold arbitrary values because they should only contain segment addresses
  • The 100010dw mmregr/m template should be used for converting all assembly instructions to machine code except MOV ES, AX instruction.
  • The instruction that performs logical AND operation and the result of the operation is not stored in the destination operand is TEST
  • The instruction inverts the carry flag is CMC
  • The group of instructions used to shift or rotate bits left or right in register or memory operands is Bit Manipulation Instructions
  • The data after executing each instruction C=1 AL=1010 1011, RCR AL, 5, is BD
  • The data after executing each instruction C=1 AL=1010 1011, ROR AL, 4, is BA
  • The data after executing each instruction C=0 AL=1100 0111, ROL AL, 2, is 1F
  • The data after executing each instruction C=0 AL=0100 1101, SAR AL, 4, is 04
  • The data after executing each instruction C=1 AL=1010 1010, SHR AL, 5, is 05
  • The data after executing each instruction C=1 AL=0011 1011, SHL AL, 3, is D8
  • The mnemonic instruction rotates left with carry the low count register content, twenty times, RCL CL, 20
  • The mnemonic instruction logically gives the result of the content of data register with of the data contained at the memory location addressed by 0919h and the segment register, DS. The answer is stored at the data register is OR DX, DS:[0919H]
  • The mnemonic instruction jumps to a memory location labeled as ANGAT after performing addition, and there is a carry: JC ANGAT
  • The mnemonic instruction immediately adds the data valued 0919H with the accumulator and the carry: ADC AX, 0919H
  • The mnemonic instruction adds one to the content of a memory location whose offset addresses are from base index register and source index register: INC ES:[BX+SI]
  • The data after executing the instruction RCR AL, 5 . Given C=1 and AL=1011 1001, is AL=9DH
  • The data after executing the instruction SAR AL, 3. Given C=1 and AL=1011 1001, is AL=F7H
  • The data after executing the instruction SHL AL, 3. Given C=1 and AL=1011 1001, is AL=C8H
  • The data after executing the instruction ROR AL, 3 . Given C=1 and AL=1011 1001, is AL=37H
  • The data after executing the instruction ROL AL, 2. Given C=1 and AL=1011 1001, is AL=E6H
  • The data after executing the instruction SHR AL, 5 . Given C=1 and AL=1011 1001, is AL=05H
  • The mnemonic instruction rotates right the destination index register twenty-nine times is ROR DI, 29
  • The mnemonic instruction logically multiplies the contents of the base index register and the data contained in the address formed by FC45H and the data segment and stores the result at the base index register is AND BX, [FC45H]
  • The mnemonic instruction immediately adds the data valued 0929H with the count register is ADC CX, [0929H]
  • The mnemonic instruction subtracts one to the content of memory location whose offset addresses are from destination index register and base pointer register is DEC ES:[DI+BP]
  • The mnemonic instruction sets bit number two of lower base index register after testing is BTS BL, 2
  • The final content of the lower accumulator after executing the instruction SAR AL, 6. Given AL=1101 1101; C=1, is AL=FFH
  • The mnemonic instruction subtracts with borrow the data addressed formed by the source index register from the higher base index register: SBB BH, [SI]
  • The final content of the lower accumulator after executing the instruction SHL AL, 4. Given AL=0111 1101; C=1 is AL = A0H
  • Given the following bytes: 1-1000 1000, 2 - 0011 0110, 3 - 1011 0111, 4 - 0110 1101, the equivalent mnemonic MOV instruction is MOV [BP+6DB7H], DH
  • The mnemonic instruction complements the content of the lower base index register: NOT BL
  • Given the following bytes: Byte 1- 1100 0110, Byte 20110 1001, Byte 3 1010 0110, Byte 4- 1100 1100, Byte 5- 1110 0101, Byte 6 - 1011 1001, the mnemonic MOV instruction is MOV DS:[BX+DI+A6H], B9E5H
  • The final content of the accumulator after executing the instruction ROR AL, 7. Given AL=1101 1001; C=1 is AL=B3H
  • The final content of the accumulator after executing the instruction RCL AL, 3. Given AL= 1001 1101; C=1 is AL=EEH
  • he instruction performing subtraction without changing the content of the destination is CMP
  • From the given program, the hand-code equivalent of line 1, "ONE: MOV AX, 1001H" is B80110
  • From the given program, the hand-code equivalent of line 3, "MOV SI, [BP+DI]" is 8B33
  • From the given program, the hand-code equivalent of line 4, "MOV DI, [BX+SI]" is 8B38
  • From the given program, the hand-code equivalent of line 7, "TWO: SUB DX, [BX+SI]" is 2B10H
  • From the given program, the hand-code equivalent of line 9, "CMP [DI], SI" is 3935
  • From the given program, the hand-code equivalent of line 10, "JZ ONE" is 74EA
  • From the given program, line 3 is located in address/es 28643-28644
  • From the given program, line 5 is located in address/es 28647-28649
  • From the given program, line 8 is located in address/es 2864E-2864F
  • From the given program, line 14 is located in address/es 28657-28658
  • From the given program, the displacement in line number 14 is F3.
  • To accomplish the given task, the missing instruction (1) is MOV BL, 08H
  • To accomplish the given task, the missing instruction (2) is MOV AX, 0094H
  • To accomplish the given task, the missing instruction (3) is DIV BL
  • To accomplish the given task, the missing instruction (4) is MOV DL, AL
  • To accomplish the given task, the missing instruction (5) is MOV AH, 00H
  • To accomplish the given task, the missing instruction (6) is POP DX
  • To accomplish the given task, the missing instruction (7) is MOV AX, 0040H
  • To accomplish the given task, the missing instruction (8) is ADD AL, 8EН
  • To accomplish the given task, the missing instruction (9) is MOV BL, AL
  • To accomplish the given task, the missing instruction (10) is SUB AX, BX
  • The final content of the register AX after simulating the whole program is AX= 104BH
  • The final content of the register BX after simulating the whole program is BX=0096H
  • The final content of the register DX after simulating the whole program is DX=0002H
  • The final content of the stack after simulating the whole program is STACK= EMPTY

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

8086 Instruction Set Quiz
41 questions

8086 Instruction Set Quiz

SpiritualRutherfordium avatar
SpiritualRutherfordium
Assembly Data Transfer & Addressing
39 questions
Use Quizgecko on...
Browser
Browser