Instruction Set of 8086 Part 1: Introduction Flashcards
(20 cards)
What are the three types of programming languages?
“High-Level Language: Machine-independent, natural language text (e.g., C++, Java). Assembly Language: Mnemonics for machine code, faster/smaller programs but machine-dependent (e.g., MOV, ADD). Machine Code: Binary instructions unique to a microprocessor (e.g., 01010011).”
What are the advantages of Assembly Language?
“Advantages: Faster/short programs, easy to read/write to memory/I/O ports, reduced errors. Disadvantages: Machine-dependent, many instructions for small tasks.”
What is the 8086’s Instruction Set Architecture (ISA)?
“The set of ~117 instructions supported by the 8086, consisting of opcode (operation) and optional operands. Assembly language is case-insensitive.”
What are the four fields in an Assembly Language syntax line?
“1. Label (ends with colon, e.g., START:
). 2. Opcode (operation, e.g., ADD
). 3. Operands (data for the opcode). 4. Comment (preceded by ;
).”
What is the purpose of the DB
assembler directive?
“Define Byte: Allocates 1 byte of memory. Example: WEIGHTS DB 18, 68, 45
creates a byte array. Use ?
for uninitialized bytes.”
What does DW
stand for in Assembly?
“Define Word: Allocates 2 bytes (16 bits). Example: SUM DW 4589
stores 4589 as a word.”
How does the ORG
directive work?
“Origin: Assigns a starting (effective) address for a segment. Example: ORG 0010h
sets the next data item to offset 0010h.”
What is the difference between NEAR
and FAR
calls?
“NEAR: Intra-segment call (within the same segment). FAR: Inter-segment call (different segments).”
What are the rules for naming labels in Assembly?
“1. 1–31 characters.
2. Letters, digits, ?
, .
, @
, _
, $
.
3. First character cannot be a digit.
4. Cannot use reserved words (e.g., MOV
).”
What are the three memory segments in an Assembly program?
“1. Data Segment: Variables and constants. 2. Stack Segment: Allocates stack memory. 3. Code Segment: Program instructions.”
What is the purpose of the ENDS
directive?
“End Segment: Marks the end of a code/data/stack segment. Example: data segment ... ends
.”
What does END start
do in an Assembly program?
“Marks the end of the program and sets the entry point to the start
label. Statements after END
are ignored.”
How are ASCII strings defined in the Data Segment?
“Using single/double quotes. Example: LETTER DB 'ABC'
or LETTER DB 41h,42h,43h
.”
What is the role of the Linker in Assembly program flow?
“Converts object files (*.OBJ
) into executable files (*.EXE
) by resolving external references and combining modules.”
What are the categories of 8086 instructions?
“1. Data Transfer (MOV, XCHG). 2. Arithmetic (ADD, SUB). 3. Logical (AND, OR). 4. String Manipulation (MOVS, CMPS). 5. Control (CALL, JMP). 6. I/O (IN, OUT). 7. Other (POP, flags).”
What does DUP
do in data allocation?
“Duplicate: Repeats a value multiple times. Example: Y DB 6 DUP(0FFh)
fills 6 bytes with 0FFh
.”
What is the difference between instructions and directives?
“Instructions execute at runtime (translated to opcodes). Directives (e.g., DB
, END
) guide the assembler and do not execute.”
How is the Stack Segment allocated?
“Using dw
or dup
. Example: stack segment dw 128 dup(0) ends
allocates 128 words (256 bytes) for the stack.”
What is the EQU
directive used for?
“Equate: Assigns a value to a symbolic name without allocating memory. Example: MASK EQU 10010001B
.”
What is the structure of a procedure in Assembly?
Defined with PROC
and ended with ENDP
. Example: CONTROL PROC FAR ... CONTROL ENDP
.