Page 2 of 2

Re: Places to learn Assembly?

Posted: Fri Nov 13, 2020 1:10 pm
by sj95126
I'm going to make a suggestion everyone is going to hate, but bear with me.

I first learned x86 assembly using "debug" under DOS. You could do worse than boot up FreeDOS and try that.

I'll take a break while you stop laughing.

Think back to the days when you wrote your first line of code in the first language you learned. You wrote "x = 4" and then "print X" so you could see with your own eyes that it did exactly what it was supposed to. You'll probably want to do the same with assembly. You want to run a single MOV instruction and then inspect the registers to see that they changed. You want to do a CMP and see "whoa, it really did set the OF flag".

This is the closest you're going to get to an interactive "interpreted" assembly experience. If you've tool-savvy enough already, you could assemble some code, run gdb and step through the assembly instructions to see what each one does, but that's a lot to set up before you see any results.

You can resume laughing.

Re: Places to learn Assembly?

Posted: Fri Nov 13, 2020 1:52 pm
by Schol-R-LEA
The OP seems to have left the forum, but WTH, I might as well add my two cents, too.
CrossJava wrote:I'm 13 and already mastered most of the other languages, now it's time for a challenge.
As has already been mentioned, there are a lot of programming languages out there, and some of them are very different from the run-of-the-mill Algol derivative. However, since I am mainly mentioning this to suggest you watch at least a few of the Abelson-Sussman lectures (which cover Scheme, a language in the Lisp family) as an alternative view of programming. I'd also check out Smalltalk and Forth as ones which work quite differently from conventional languages, but I will leave it to others to offer good resources on those.
CrossJava wrote:I finished Tutorialspoint's walkthrough on it, but now I need another place to learn from that's free and high quality.
'Free' and 'high quality' tend to be antagonistic goals, but I probably don't need to tell you that. This isn't to say that there aren't any such resources, but a lot of the better ones (and many of the worse ones) will cost money.

That having been said, if you have access to a public library, there are some excellent books such as Duntemann's Assembly Language Step by Step, which has the advantage of covering NASM under Linux the same as the tutorial you've gone through already. I know that libraries aren't the easiest things to access right now due to COVID, but if you can get a copy of this from one it would be worth the effort. Otherwise, the Kindle may not be free but it isn't too expensive if you can scrape the money together or convince a family member to get it for you.

I would also suggest considering a different assembly language, either emulated or on a real single-board computer such as a Raspberry Pi. The x86 instruction set is frankly a mess, compared to something such as ARM or MIPS, and if nothing else looking at other machine types will give you some idea of what is general to most assembly languages, and what is specific to x86 PCs.

For MIPS, there aren't that many real machines which you could use, but there are a few such as the Onion Omega2, and there are many emulators such as SPIM which are usually free. Alternatively, setting up a cross-assembler and a QEMU virtual MIPS Linux image shouldn't prove too difficult. I'd have to look around for suitable tutorials and videos, but I know that ones like this one are around.

While not free, an ARM SBC such as the Raspberry Pi isn't overly expensive (under $80 US for usable system), so it might prove to be a good investment, and not just for programming. I don't know if this is something you could ask family to help with, but I trust that you could convince them that it would be educational (which probably is the case anyway). There are tons of assembly programming tutorials and videos covering the Pi, and while it is far from the best SBC around, it is far and away the most accessible for most people.

Alternatively, a neo-retro platform such as the Commander X16 is another choice, which is convenient in that there is a free emulator and multiple assemblers such as cc65 ready to be used with it. There are several free videos on Youtube covering 6502 assembly for the Commander X16, such as this one.

And there are always the OpenCourseware classes on the theory of instruction sets and such, but that may be jumping the gun a teensy bit. :-)

Re: Places to learn Assembly?

Posted: Fri Nov 13, 2020 4:07 pm
by moonchild
The single best resource I know of for learning assembly is Understanding Assembly Language (aka Reverse Engineering For Beginners). You'll learn about a bunch of other cool stuff from that book, too. (You don't have to give your email to read the book; it's available right here.)

Re: Places to learn Assembly?

Posted: Sun Nov 22, 2020 1:22 pm
by frn2000
As a total noob when it comes to assembler, what's the best and easiest distro to learn -- FASM, NSAM, YASM, JWASM or some other ASM? Thank you.

Re: Places to learn Assembly?

Posted: Mon Nov 23, 2020 12:17 pm
by pvc
I've learn't my asm skills from PASS32 assembler bundled with some old gaming magazine. It was an assembler written by some german guy. It had awesome tutorials included,ranging from basic move instruction, to implementing dynamic linker. I think the author was Dieter Pawelczak (I think, he is a doctor or something now).

Re: Places to learn Assembly?

Posted: Thu Nov 26, 2020 8:45 am
by frn2000
pvc wrote:I've learn't my asm skills from PASS32 assembler bundled with some old gaming magazine. It was an assembler written by some german guy. It had awesome tutorials included,ranging from basic move instruction, to implementing dynamic linker. I think the author was Dieter Pawelczak (I think, he is a doctor or something now).
I found some information on PASS32 at http://www.manmrk.net/tutorials/assembly/a.htm#P.
The Pass32 Assembler is a free x86 Assembler to easily create protected mode and DOS applications. The Assembler directly links a dos extender to the application - there's no complicated linking needed. The Assembler comes together with the Pro32 Dos Extender, but is also compatible to other Dos Extenders like WDOSX, etc. The Assembler provides a large run time library with std. I/O, heap management, file handling & VESA graphic functions. Pass32 comes with a complete documentation and many example programs. The Assembler and Dos Extender are compatible with plain DOS, Win31, Win9X and WinNT platforms.
Pawelczak's website was http://www.geocities.com/SiliconValley/Bay/9159/ (ERROR 404). That's how old PASS32 is! I'm going to check it out. Hopefully it runs on DOSBox. Thank you.

Re: Places to learn Assembly?

Posted: Sat Dec 19, 2020 11:46 pm
by Seasoft
Schol-R-LEA wrote:The OP seems to have left the forum, but WTH, I might as well add my two cents, too.
CrossJava wrote:I'm 13 and already mastered most of the other languages, now it's time for a challenge.
As has already been mentioned, there are a lot of programming languages out there, and some of them are very different from the run-of-the-mill Algol derivative. However, since I am mainly mentioning this to suggest you watch at least a few of the Abelson-Sussman lectures (which cover Scheme, a language in the Lisp family) as an alternative view of programming. I'd also check out Smalltalk and Forth as ones which work quite differently from conventional languages, but I will leave it to others to offer good resources on those.
CrossJava wrote:I finished Tutorialspoint's walkthrough on it, but now I need another place to learn from that's free and high quality.
'Free' and 'high quality' tend to be antagonistic goals, but I probably don't need to tell you that. This isn't to say that there aren't any such resources, but a lot of the better ones (and many of the worse ones) will cost money.

That having been said, if you have access to a public library, there are some excellent books such as Duntemann's Assembly Language Step by Step, which has the advantage of covering NASM under Linux the same as the tutorial you've gone through already. I know that libraries aren't the easiest things to access right now due to COVID, but if you can get a copy of this from one it would be worth the effort. Otherwise, the Kindle may not be free but it isn't too expensive if you can scrape the money together or convince a family member to get it for you.

I would also suggest considering a different assembly language, either emulated or on a real single-board computer such as a Raspberry Pi. The x86 instruction set is frankly a mess, compared to something such as ARM or MIPS, and if nothing else looking at other machine types will give you some idea of what is general to most assembly languages, and what is specific to x86 PCs.

For MIPS, there aren't that many real machines which you could use, but there are a few such as the Onion Omega2, and there are many emulators such as SPIM which are usually free. Alternatively, setting up a cross-assembler and a QEMU virtual MIPS Linux image shouldn't prove too difficult. I'd have to look around for suitable tutorials and videos, but I know that ones like this one are around.

While not free, an ARM SBC such as the Raspberry Pi isn't overly expensive (under $80 US for usable system), so it might prove to be a good investment, and not just for programming. I don't know if this is something you could ask family to help with, but I trust that you could convince them that it would be educational (which probably is the case anyway). There are tons of assembly programming tutorials and videos covering the Pi, and while it is far from the best SBC around, it is far and away the most accessible for most people.

Alternatively, a neo-retro platform such as the Commander X16 is another choice, which is convenient in that there is a free emulator and multiple assemblers such as cc65 ready to be used with it. There are several free videos on Youtube covering 6502 assembly for the Commander X16, such as this one.

And there are always the OpenCourseware classes on the theory of instruction sets and such, but that may be jumping the gun a teensy bit. :-)
I'm sure everyone has good tips on here and each have their own pros and cons. I might argue that while learning a non-x86 assembly might be a good idea, it could distract from his purpose to OS Dev for x86 platform, which I assume here.

But good work. :D

Re: Places to learn Assembly?

Posted: Sun Dec 20, 2020 4:30 am
by clementttttttttt
Books are your friends.

Re: Places to learn Assembly?

Posted: Sun Dec 20, 2020 9:57 am
by frn2000
Seasoft wrote:
Schol-R-LEA wrote:The OP seems to have left the forum, but WTH, I might as well add my two cents, too.
That having been said, if you have access to a public library, there are some excellent books such as Duntemann's Assembly Language Step by Step, which has the advantage of covering NASM under Linux the same as the tutorial you've gone through already. I know that libraries aren't the easiest things to access right now due to COVID, but if you can get a copy of this from one it would be worth the effort. Otherwise, the Kindle may not be free but it isn't too expensive if you can scrape the money together or convince a family member to get it for you.
Someone put the Duntemann's book in Github.

Re: Places to learn Assembly?

Posted: Sun Jan 10, 2021 8:33 am
by eekee
frn2000 wrote:Someone put the Duntemann's book in Github.
Duntemann wrote:Note well: When somebody asks you, "Why would you want to do that?" what it really means is this: "You've asked me how to do something that is either impossible using tools that I favor or completely outside my experience, but I don't want to lose face by admitting it."
He's dead right there! It took me far too long to realise that.

Re: Places to learn Assembly?

Posted: Sun Jan 10, 2021 9:40 am
by Solar
eekee wrote:
Duntemann wrote:Note well: When somebody asks you, "Why would you want to do that?" what it really means is this: "You've asked me how to do something that is either impossible using tools that I favor or completely outside my experience, but I don't want to lose face by admitting it."
He's dead right there! It took me far too long to realise that.
It could also mean "I have enough experience with the subject matter to know that this is a really dumb thing to do that will come back to bite us in the arse later". Just as well.

The trick is to have the awareness of your relative experience sets to tell the two apart.

Re: Places to learn Assembly?

Posted: Sun Jan 10, 2021 9:46 am
by PeterX
eekee wrote:
Duntemann wrote:Note well: When somebody asks you, "Why would you want to do that?" what it really means is this: "You've asked me how to do something that is either impossible using tools that I favor or completely outside my experience, but I don't want to lose face by admitting it."
He's dead right there! It took me far too long to realise that.
Or it sometimes means: "That is outside of my limited imagination. I will stick to the pathes others have gone before me. And so should you."
(Which is nonsense, of course. Imagine all people were that way! We still would use stone tools, maybe not even those.)

Greetings
Peter

Re: Places to learn Assembly?

Posted: Sun Jan 10, 2021 10:54 am
by eekee
Solar wrote:It could also mean "I have enough experience with the subject matter to know that this is a really dumb thing to do that will come back to bite us in the arse later". Just as well.

The trick is to have the awareness of your relative experience sets to tell the two apart.
Good point, but it can take a lot of awareness. I guess that's what really took me years. The fun part is when something would indeed be dumb in someone else's world, but makes perfect sense for what you're trying to do. Just-about all of Forth is like that. ;)

Re: Places to learn Assembly?

Posted: Mon Jan 11, 2021 8:08 am
by bzt
frn2000 wrote:As a total noob when it comes to assembler, what's the best and easiest distro to learn -- FASM, NSAM, YASM, JWASM or some other ASM? Thank you.
I would recommend FASM, because it's easy to set up (on both Win and Unix), has straightforward syntax (mostly Intel with some additions, in contrast to AT&T), very intuitive and powerful macro system, good and very detailed documentation (including x86 instructions), lightning fast compilation times, finally a friendly community and active developer on the forum (aka Message Board) with tons of examples.

NASM is not bad either, you might find more examples with it on the net, but less supportive forum, and its macro system is nowhere near sophisticated as FASM's.

Eventually to get pro you'll have to learn GAS (AT&T syntax and the quirks of inline assembly and C precompiler with Assembly). But don't start there, it's hard.

Cheers,
bzt