New Reply

a problem with coding in 8085 microprocessor

 
Share Thread
Sep8-12, 03:04 PM   #1
 

a problem with coding in 8085 microprocessor


After i had studied and implemented codes to perform basic arithematic operations, factorial of a number, look-up tables, i got stuck at a pretty silly problem, while coding with the 80085 simulator:

MVI A,000H
STA 0001H
MVI A,0001H
STA 0002H
LXI H,0001H
MOV A,M
LXI B,0002H
STAX B
HLT
This piece of code is supposed to load the value 01H in the memory location 0002H. But it doesno't go as i expected. Where is the error with my logic.
PhysOrg.com science news on PhysOrg.com

>> New language discovery reveals linguistic insights
>> US official: Solar plane to help ground energy use (Update)
>> Four microphones, computer algorithm enough to produce 3-D model of simple, convex room
Sep9-12, 09:27 AM   #2
 
Recognitions:
Science Advisor Science Advisor
Quote by dragonflyv2 View Post
MVI A,000H
STA 0001H
MVI A,0001H
STA 0002H
LXI H,0001H
MOV A,M
LXI B,0002H
STAX B
HLT
This piece of code is supposed to load the value 01H in the memory location 0002H. But it doesno't go as i expected. Where is the error with my logic.

Assuming that you have RAM at memory address 0000...?, then that program should store zero at both address 0000 and 0001, though it's a convoluted way of doing it. What are you actually trying to achieve?

Basically your program does the following
- stores 00 at location 0001
- stores 01 at location 0002
- transfers the contents of 0001 to 0002
New Reply

Tags
discussion, microprocessor

Similar discussions for: a problem with coding in 8085 microprocessor
Thread Forum Replies
Need help with coding problem Programming & Comp Sci 4
8085 microprocessor question Electrical Engineering 2
8085 weird problem Engineering, Comp Sci, & Technology Homework 4
IFORT Coding Problem (Simpson's Rule) Engineering, Comp Sci, & Technology Homework 3
8085 Microprocessor ? Electrical Engineering 1