Search This Blog

Wednesday, March 9, 2011

Sample Programs

Program to multiply a number by 8
---------------
MVI A, 30H
RRC
RRC
RRC
OUT PORT1
HLT
----------------

Program to find greatest between two numbers
----------------
MVI B, 30H
MVI C, 40H
MOV A, B
CMP C
JZ EQU
JC GRT
OUT PORT1
HLT
EQU: MVI A, 01H
OUT PORT1
HLT
GRT: MOV A, C
OUT PORT1
HLT
----------------

No comments:

Post a Comment