r/AskProgramming • • 10d ago

Other Universal tips for beginner assembly programmers?

I know some of you out there have tips for me and other people seeing this post.

2 Upvotes

19 comments sorted by

View all comments

3

u/gm310509 10d ago

Start simple. Take it step be step.

Don't jump into the deep end and try and learn 64 bit Intel. Start with something like an 8 bit 6502, Z-80, AVR (try Arduino). Learn the basics - jump up to something more complex like a 32 bit Arm Cortex.

Basically, don't put yourself in an information overload situation.

IMHO.

2

u/Recent-Day3062 9d ago

Could not be more right. They eventually turned the machine language instruction set into something more resembling a high level language. What would be absolutely easiest would be a stack-based RPN type thing with a few memory move instructions and some minimal flow control.

I have looked at some modern architectures and cannot figure out what all the sets of registers even are

1

u/gm310509 9d ago

Actually I forgot about the "stack-based RPN type thing"

I used to own a programmable Hewlett Packard calculator - which was a "stack based RPN thing" - and programming it was my first foray into (I guess a type of) assembly language.

It was a fairly easy learning curve as the "assembly language" was pretty much just recording the key sequences you might do in a calculation with the addition of tests (e.g. x == 0? x != y? etc), branching, some other useful (for programming) instructions such as (INC x, DEC x) and indirect addressing (into the 100 memory locations).

2

u/Recent-Day3062 9d ago

That’s where I was coming from. I still use one, but never the programming feature. But conceptually every key for a function is a dispatch code in hex, with the stack holding all vars.

Min essence, numerical input is sort of an escape sequence (ala EMacs self-insert binding) and outs numbers on the stack wirh Enter being a push

1

u/gm310509 9d ago

Actually now that I think about it, the HP wasn't my first programmable calculator. Prior to that I had a TI-59 with the magnetic card reader.

I switched to the HP-41CX when the TI broke (that was a sad day). The HP was extra cool (at the time) because it had an alphanumeric display.

The TI was infix notation, whereas the HP of course is RPN (or postfix notation).

I still have the HP - but don't use it very much nowadays.

2

u/Recent-Day3062 9d ago

I have 3 HP I use to this day.

It’s sort of impressive how good RPN is once you get the hang of it. People think of mine as that “weird” calculator but I am amazingly fast.

Ice downloaded infix calculators on my iPhone, and I simply csnt use them. “3x(7+4)” is just impossible becuase I default to RPN

1

u/gm310509 8d ago

... how good RPN is .... People think of mine as that “weird” calculator ...

To me, this was the best feature. I agree that it is easy and fast once you get the hang of it - which wasn't that hard IMHO.

But that isn't why I said it was its best feature. The reason I say that, and I'm sure you experienced it to is the inevitable person(s) who don't bother to bring their calculator and are always "borrowing" (i.e. hogging) somebody else's calculator.

I remember at University and High School that everybody else always had to make excuses when the "hogs" approached them or try to chase the "hogs" down to get their calculators back.

When the "hogs" asked me, I said "Sure, here you go" knowing full well that it would be returned in less than 60 seconds! 🤔😉😊

1

u/Recent-Day3062 7d ago

Unfortunately I went to engineering school and everyone used RPN so I didn’t get the benefit you did

1

u/gm310509 7d ago

LOL, bad luck.