OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 23, 2021 8:51 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Places to learn Assembly?
PostPosted: Fri Nov 13, 2020 1:10 pm 
Offline
Member
Member

Joined: Tue Aug 11, 2020 12:14 pm
Posts: 147
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.


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Fri Nov 13, 2020 1:52 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1771
Location: Athens, GA, USA
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. :-)

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
μή εἶναι βασιλικήν ἀτραπόν ἐπί γεωμετρίαν
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Fri Nov 13, 2020 4:07 pm 
Offline
Member
Member

Joined: Wed Apr 01, 2020 4:59 pm
Posts: 65
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.)


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Nov 22, 2020 1:22 pm 
Offline

Joined: Sat Nov 21, 2020 11:43 pm
Posts: 3
Location: United States
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.

_________________
https://vintageos.org/frn2000.html


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Mon Nov 23, 2020 12:17 pm 
Offline
Member
Member
User avatar

Joined: Mon Jan 15, 2018 2:27 pm
Posts: 167
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).


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Thu Nov 26, 2020 8:45 am 
Offline

Joined: Sat Nov 21, 2020 11:43 pm
Posts: 3
Location: United States
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.
Quote:
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.

_________________
https://vintageos.org/frn2000.html


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sat Dec 19, 2020 11:46 pm 
Offline

Joined: Wed Sep 02, 2020 3:09 am
Posts: 14
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


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Dec 20, 2020 4:30 am 
Offline
Member
Member

Joined: Tue Jul 14, 2020 4:01 am
Posts: 60
Books are your friends.


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Dec 20, 2020 9:57 am 
Offline

Joined: Sat Nov 21, 2020 11:43 pm
Posts: 3
Location: United States
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.

_________________
https://vintageos.org/frn2000.html


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Jan 10, 2021 8:33 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 548
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.

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Jan 10, 2021 9:40 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7506
Location: Germany
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.

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Jan 10, 2021 9:46 am 
Offline
Member
Member

Joined: Fri Nov 22, 2019 5:46 am
Posts: 590
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


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Jan 10, 2021 10:54 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 548
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. ;)

_________________
Kaph link pending. code pending. design pending. plans in a state of flux! everything pending! choice of language still up in the air! why is nothing coming together?!?


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Mon Jan 11, 2021 8:08 am 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1468
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group