Coal Lab 1 Output Screen Short
Coal Lab 1 Output Screen Short
Objective:
Introduction to Assembly
Working of Assembler
MASM settings
◦ Command Prompt
Low-level language
Directly influenced by the instruction set and architecture of the processor (CPU)
Most high-level language instructions need more than one assembly instruction
mov size,AX
add AX,x
add AX,y
add AX,z
mov sum,AX
Readability of assembly language instructions is much better than the machine language
instructions
◦ Efficiency
Space-efficiency
Time-efficiency
Space-efficiency
Time-efficiency
Assembler is such program that converts source-code programs from assembly language
to machine language. It generates
DOSBOX 0.74
Installing DOSBOX
Interface:
Drive mounting
• The 8086 (also called iAPX 86) is a 16-bit microprocessor chip designed
by Intel between early 1976 and mid-1978, when it was released.
• It has a 20-bit address bus and a 16-bit data bus.
• As a programmer of 8086 you must become familiar with various registers.
• The most significant byte of each register can be addressed directly (e.g AL is the
LS byte of AX, CH is MS byte of CX)
o When you modify any of the 8 bit registers 16 bit register is also updated,
and vice-versa. The same is for other 3 registers, "H" is for high and "L" is
for low part.
• Registers are located inside the CPU, they are much faster than memory. accessing
a memory location requires the use of a system bus, so it takes much longer.
• Accessing data in a register usually takes no time. therefore, you should try to
keep variables in the registers for manipulation.
AX Multiply/divide
Instruction:
o Mnemonic (Required)
Type of Operands:
• Immediate
o A constant Integer of 8 or 16 bit.
• Register
o Name of register.
• Memory
o References to Memory Location.
Instruction Set:
IN, OUT Input byte or word from port, output word to port
Mnemonic Function
• NOT operand
o Invert each bit of operand
o Example
o MOV AL, 00011011b
o NOT AL; (Value of AL will be 11100100)
• AND operand1, operand2
o Logical AND between all bits of two operands
o Example
• MOV AL, 110011000b
• AND AL, 001101110b
• OR operand1, operand2
o Logical OR between all bits of two operands
o Example
• MOV AL, 00001100b
• OR AL, 00110111b; (AL = 00111111)
• XOR operand1, operand2
o Logical XOR between all bits of two operands
o Example
• MOV AL, 11001100b
• XOR AL, 00000111b ; (AL = 11001011)
Mnemonic Function
Arithmetic Instructions:
CBW, Convert byte to word, word to double word (useful before multiply/divide)
CWD
AAD
DAA, Decimal adjust for addition, subtraction (binary coded decimal numbers)
DAS