Professional Documents
Culture Documents
This representation is usually defined by the hardware manufacturer, and is based on mnemonics [MOV, ADD, SUB, INC, CPL] that symbolize processing steps (instructions), processor registers, memory locations, and other language features.
8-Bit register/Memory/Port
The 8 bits of a register are shown from MSB D7 to the LSB D0
Basic Commands
Command ACALL Description Absolute Call
ADD
ANL CJNE CLR
Add Accumulator
Bitwise AND Compare and Jump if Not Equal Clear Register
CPL
DEC DJNZ INC JB JBC JC JMP
Complement Register
Decrement Register Decrement Register and Jump if Not Increment Register Jump if Bit Set Jump if Bit Set and Clear Bit Jump if Carry Set Jump to Address
JNZ
JZ LCALL LJMP
MOV
NOP ORL RET SETB SJMP SUBB
Move Memory
No Operation Bitwise OR Return From Subroutine Set Bit Short Jump Subtract From Accumulator With Borrow
Solution:
38 +2F 67 00111000 00101111 01100111
CY = 0 since there is no carry beyond the D7 bit AC = 1 since there is a carry from the D3 to the D4 bi P = 1 since the accumulator has an odd number of 1s (it has five 1s)
Loop
Write a program to add value 3 to the Accumulator ten times using Loop DIY [Do it Yourself]
ORG 0H MOV A,#00H MOV R2,#10H AGAIN: ADD A,#03H DJNZ R2,AGAIN MOV R5,A END ; A=0, clear ACC ;load counter R2=10 ;add 03 to ACC ;repeat until R2=0,10 times ;save A in R5
DELAY: HERE:
;---time delay-------
AND operation
Write a program to do AND operation between Accumulator & R1 DIY [Do it Yourself]
ORG 0H MOV A,#0FH MOV R1,#0F1H ANL A,R1 END
0FH 0F1H
01H AND Operation
00001111 11110001
00000001
OR operation
Write a program to do OR operation between Accumulator & R1 DIY [Do it Yourself]
ORG 0H MOV A,#0FH MOV R1,#0F1H ORL A,R1 END
OFH 0F1H
FFH OR Operation
00001111 11110001
11111111
NOT operation
Write a program to do NOT operation DIY [Do it Yourself]
ORG 0H MOV A,#0FH CPL A END
OFH F0H
00001111 11110000
NOT Operation