I can't seem to understand how to I make it
I have been trying to use it this way:
MOV @RO,1 INC R0 MOV @R0,2 DEC R0 ;to point back to the 1st value
and it should save value 1 and 2, but it ends up making weird things
any help? Thanks
It's bible time, especially the FAM_PROG_GUIDE
www.danlhenry.com/.../80C51_FAM_ARCH_1.pdf www.danlhenry.com/.../80C51_FAM_HARDWARE_1.pdf www.danlhenry.com/.../80C51_FAM_PROG_GUIDE_1.pdf
is there a fast way to do this? I only need a simple one
You're moving the value from address 1 and 2. If you want to move the immediate value, you'll have to write #1 and #2, see: http://www.keil.com/support/man/docs/is51/is51_mov.htm
yes, I made a mistake when I was writing here, but the problem is that it seems to be threating r0 and @r0 the same way for some reason
UPDATE:
I figured it out, thanks very much for everyone who replied
Please send me detailed description of Your problem (including the source text), we'll be glad to help You.
Eric, You are a professional after all, why You send all of beginners to bible? Please help them. I think they reads the needed books.
?ID?TEST SEGMENT IDATA RSEG ?ID?TEST ADDRESS: DSB 16 ?PR?TEST SEGMENT CODE INBLOCK RSEG ?PR?TEST TEST: MOV R1,#ADDRESS MOV R2,#8 loop: MOV @R1,#1 INC R1 MOV @R1,#2 INC R1 DJNZ R2,loop RET
// try this and learn the assembler
The replies to those, in order, are: Yes, he is. Because they need it. That's exactly what he's been doing. No, they don't, or they wouldn't need to be pointed towards the bible.
To slightly expand on the latter aspect: no, these guys don't read the necessary books. That entire generation appears to have summarily discarded the concept of learning stuff by reading. They refuse to read anything thicker than their current cell phone. And woe betide anyone who dares telling them that blind copy'n'paste is no way to learn any engineering discipline.
The OP was supposed to learn something by writing that code, but cheated instead. Now you're about to deprive him even of his last opportunity to learn it, which was by finding out, all by himself, what's actually wrong with the stuff he stole from somewhere on the internet.
I guess Igor is a student.
Students tends to team up in cheating fraternities and share best practices how to find ready-to-use code that someone else wrote and how to later pretend it was own code and that the actual functionality of the code - and the reason for the code - is actually known.
I think it's a common idea among the younger generation that the brain can only manage a limited number of thoughts - and these better be saved for some other day. That the brain actually functions as a muscle - getting better capacity if trained - seems to have totally went over their heads. Or maybe in through one ear and without any resistance from active brain cells directly left through the other ear.
If "let me write the code for you" was an efficient way to teach things, then I would have thought all teachers would spend their time writing the required code for their students. Just that the people who manages to write the code themselves tends to get so very much better grades a bit down the line. The more cheating at the start of a course or a subject, the more totally lost you will be a bit later.
An interesting thing to consider: Where would all teachers be, if the teachers had spent their study years just trying to copy someone elses solutions.
Hello Per!
You are wrong here - I'm not a student, I'm assembly programmer which has many fortunate projects. As You (and Eric) have the tendency to send all of beginners to sit at the school desk, I want to help them instead. Please don't blame me.
Regards, Igor.
But how is it helping, if the goal isn't to give the requester the toolbox to be able to solve their problems themselves?
"Programming by asking on forums" is an extremely slow and inefficient way to get some work done. Especially since the answers to forum questions is normally limited to the original question - so a bad question gives a bad answer. Only own knowledge lets people realize that maybe they should have asked a completely different question or maybe avoided them from running into a dead end in the first place.
Software development really do requires lots of reading. And more importantly - it requires the knowledge of how to sift and locate the relevant information.