ASM code for 8 Bit Subtraction - 8051 - AT89C51 - Assembly


Flowchart:-



Program:-

ORG 0000H
CLR A
MOV DPTR ,#2001 H
MOVX A,@DPTR
MOV R2,A
DEC DPL
MOVX A,@DPTR
SUBB A, R2
INC DPTR
INC DPTR
INC DPTR
MOVX @DPTR, A
JNC STEP1
Mov A, 0FFH
DEC DPL
MOVX @DPTR, A
SJMP
STEP1 : MOV A, #00H
DEC DPL
MOVX @DPTR, A
SJMP
END

Output:-



For more ASM programs - click here

Popular posts from this blog