P. 1
The 8051 Micro Controller and Embedded Systems Using Assembly and C-2nd-Ed

The 8051 Micro Controller and Embedded Systems Using Assembly and C-2nd-Ed

4.5

|Views: 336|Likes:
Published by api-27236542
The 8051 Microcontroller and Embedded Systems Using Assembly and C-2nd-ed.pdf by Muhammad Ali Mazidi, Janice Mazidi and Rolin McKinlay.......full book
The 8051 Microcontroller and Embedded Systems Using Assembly and C-2nd-ed.pdf by Muhammad Ali Mazidi, Janice Mazidi and Rolin McKinlay.......full book

More info:

Published by: api-27236542 on Oct 18, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/21/2015

pdf

text

original

Write code to send 55H to ports P1 and P2, using

(a) their names (b) their addresses

Solution :

(a) MOV A,#55H ;A=55H

MOV P1,A ;P1=55H

MOV P2,A ;P2=55H

(b) From Table 5-1, P1 address=80H; P2 address=A0H

MOV A,#55H ;A=55H

MOV 80H,A ;P1=55H

MOV 0A0H,A ;P2=55H

Department of Computer Science and Information Engineering
National Cheng Kung University, TAIWAN

11

HANEL

ACCESSING
MEMORY

Stack and
Direct
Addressing
Mode

Only direct addressing mode is allowed
for pushing or popping the stack

PUSH A is invalid

Pushing the accumulator onto the stack
must be coded as PUSH 0E0H

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->