Need help to Add numbers to X and Y registures

Building your first 6502-based project? We'll help you get started here.
LASERACTIVEGUY
Posts: 18
Joined: 29 Dec 2015

Re: Need help to Add numbers to X and Y registures

Post by LASERACTIVEGUY »

Something clicked around 3am this morning.... I get it now, at least the basics. I even wrote a little code this morning after a short nap, and it worked flawless the first time with no debugging! I couldn't understand that there are 3 reg's, the X, the Y and the Accumulator. Even went back and shortened the first code 3 bytes. I'll read these posts about the 6502 information later today, I'm sure it will be very informative. You guys are the best! Thank you much!
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Need help to Add numbers to X and Y registures

Post by BigDumbDinosaur »

barrym95838 wrote:
BigDumbDinosaur wrote:
...
  • You assemble your source code, not compile it.
    ...
  • The program that assembles your source code is referred to as an assembler, not a compiler (they are two very different animals).
...
http://cs.stackexchange.com/questions/1 ... -assembler
  • An assembler is a compiler which performs a specific set of tasks. The terms have somewhat diverged in practice, but the basic definition of "compiler" (translate between languages) applies.
Don't believe everything you read on the Internet. :lol:
Quote:
Are they really that different, BDD? :wink:
Actually they are. The statements in assembly language source code, disregarding pseudo-ops and macros, have a one-for-one correspondence with the resulting object code. The statements in the source code that is to be fed to a compiler don't have that characteristic. Something as simple as X++ in ANSI C could generate a whole series of machine instructions when compiled. Its equivalent in 6502 assembly language might be assembled as INX, assuming the .X register was holding the value corresponding to X.

In most computer science courses, the professor would correct someone who used the term "compiler" to refer to an "assembler," or vice versa.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Need help to Add numbers to X and Y registures

Post by BigEd »

A good teacher knows when correction is mere pedantry, and a distraction for everyone else.
LASERACTIVEGUY
Posts: 18
Joined: 29 Dec 2015

Re: Need help to Add numbers to X and Y registures

Post by LASERACTIVEGUY »

This is an example of the LoRes Graphic Digitizer for Apple II your 'simple help' allowed me to do...
https://www.youtube.com/watch?v=zH8iBubD69w

And also ended a year's worth of confusion reading assembly books, but remaining in the fog despite many weekends scratching my head! Thanks again! -Tom
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Need help to Add numbers to X and Y registures

Post by BigDumbDinosaur »

LASERACTIVEGUY wrote:
And also ended a year's worth of confusion reading assembly books, but remaining in the fog despite many weekends scratching my head!
That is why we consistently recommend the Lichty and Eyes manual published by Western Design Center. It does a thorough job of getting assembly language beginners up to speed.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Need help to Add numbers to X and Y registures

Post by BigDumbDinosaur »

BigEd wrote:
A good teacher knows when correction is mere pedantry, and a distraction for everyone else.
A good teacher teaches and doesn't accept mediocrity as "good enough." :D My teachers back when I was learning all this stuff didn't accept anything other than what is correct. Call that pedantry if you must, but I agree with that philosophy. I have too often seen first-hand what happens when the "good enough" attitude is in play. :evil:
x86?  We ain't got no x86.  We don't NEED no stinking x86!
LASERACTIVEGUY
Posts: 18
Joined: 29 Dec 2015

Re: Need help to Add numbers to X and Y registures

Post by LASERACTIVEGUY »

I'm pretty much going to end the thread because the objective has been completed... but something opened my eyes about this assembly stuff just talking with you guys. I've had a couple of books in front of me and been reading them almost every weekend, and it might as well have been in greek or latin or chineese. I'm actually reading these things and every single thing makes sense, its almost funny how just a week ago I couldn't understand one thing, and I put a lot of effort behind it. I read once in another book that assembly is easier to learn than basic... I am almost to the point of believing it!

BigDumbDinosaur wrote:
BigEd wrote:
A good teacher knows when correction is mere pedantry, and a distraction for everyone else.
A good teacher teaches and doesn't accept mediocrity as "good enough." :D My teachers back when I was learning all this stuff didn't accept anything other than what is correct. Call that pedantry if you must, but I agree with that philosophy. I have too often seen first-hand what happens when the "good enough" attitude is in play. :evil:
User avatar
satpro
Posts: 47
Joined: 27 Nov 2014
Location: Ocala, Fl, USA

Re: Need help to Add numbers to X and Y registures

Post by satpro »

BigDumbDinosaur wrote:
BigEd wrote:
A good teacher knows when correction is mere pedantry, and a distraction for everyone else.
A good teacher teaches and doesn't accept mediocrity as "good enough." :D My teachers back when I was learning all this stuff didn't accept anything other than what is correct. Call that pedantry if you must, but I agree with that philosophy. I have too often seen first-hand what happens when the "good enough" attitude is in play. :evil:
A "good" teacher is one who has the ability and will to bring the best from his/her student, regardless of the student's ability. If mediocrity is the best the student is able to provide given proper and/or extraordinary effort from the teacher, then the "good" teacher will accept it without recrimination or doubt or feeling of failure. It's that simple, and it has always been that simple. We don't actually live in a new world. Rulers to the knuckles is so old-school and should never again be aspired to nor accepted.

Education is a science and an art.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Need help to Add numbers to X and Y registures

Post by BigDumbDinosaur »

LASERACTIVEGUY wrote:
I've had a couple of books in front of me and been reading them almost every weekend, and it might as well have been in greek or latin or chineese. I'm actually reading these things and every single thing makes sense, its almost funny how just a week ago I couldn't understand one thing, and I put a lot of effort behind it.
I think most people eventually experience a "Eureka!" moment with this stuff. It just takes time, patience and experimentation.
Quote:
I read once in another book that assembly is easier to learn than basic... I am almost to the point of believing it!
I recall during the 1980s a short article in Transactor magazine in which the author advocated for teaching assembly language before introducing programming students to high level languages (BASIC, in particular). The theory was that if the student understood assembly language well enough then the concepts of programming would easily carry over to the high level environment, making for a shorter learning curve.

Now, I can't vouch for whether such a teaching methodology would be appropriate in this day and age. However, I can tell you that I had been writing computer software for more than a decade before I learned a high level language. Everything I had done up to that point was either assembly language or actual machine code, since the type of work I did in those days (1970s) required working close to the bare metal. The first high level language I learned was Business BASIC, and it seemed very simple—and quite stultifying, as I wasn't accustomed to not having detailed control of everything.

It would seem that there is/was some merit to starting off aspiring programmers on assembly language before introducing them to the high level compiler or interpreter. A lot of important concepts must be understood in order to write functioning assembly language programs, concepts with which I became intimately acquainted during the early years of my computing activities. Ergo the transition for me from low level to high was painless. I suspect going the other direction would not be as pleasant for many.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Post Reply