Thursday, August 19, 2010

Microprocessors and Microcontrollers 19th Aug.

Increasing Counter(0-F)
=======================

XX: MVI B,10H
XRA A
XY: 01H
INR A
DCR B
JNZ XY
JMP XX


Decreasing Counter(F-0)
=======================

XY: MVI A,10H
XX: DCR A
OUT 01H
JNZ XX
OUT 01H
JMP XY



NOTE: INR/DCR Does not affect CARRY FLAG



Increasing Counter(00-FF)
==========================

XRA A
XY: OUT 01H
INR A
JMP XY



Decreasing Counter(FF-00)
==========================


MVI A,FFH
XX: OUT 01H
DCR A
JMP XX




FOUR NEW INSTRUCTIONS
======================

1.RAL (Rotate Accumulator Left with carry)
2.RLC (Rotate Accumulator Left)
3.RAR (Rotate Accumulator Right with Carry)
4.RRC (Rotate Accumulator Right)


Few diagrams will make u clear....

RAL:
RLC:




RAR AND RRC are just the opposite of RAL AND RLC...



Always Remember:
================

Left Shift: A number gets multiplied by 2
Right Shift: A number gets divided by 2



05H X 04 H
===========

MVI A,05H
RLC
RLC

No comments:

Post a Comment

Featured Post 1

notice

Featured Post 2

IETE

Featured Post 6

results

Featured Post 7

WBUT

Featured Post 3

Featured Post 4

Featured Post 5

Featured Post 8