OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:49 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Places to learn Assembly?
PostPosted: Mon Sep 07, 2020 12:02 pm 
Offline

Joined: Sun Sep 06, 2020 9:01 am
Posts: 1
I'm 13 and already mastered most of the other languages, now it's time for a challenge. I finished Tutorialspoint's walkthrough on it, but now I need another place to learn from that's free and high quality. Thanks! :D -Honest


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Fri Sep 11, 2020 8:48 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
I learned assembly through reverse-engineering and modifying existing software. It may not be the easiest way to do it, but it's a lot more fun prodding an existing program to change what it does, and I personally found it a lot easier to follow the logic in an existing program instead of trying to write one from scratch.

I also started with 6502 assembly in a NES emulator with a debugger. It's a bit simpler than x86, and the bright colors are more engaging than most distractions. :P


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sat Sep 12, 2020 2:12 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Not wishing to detract from your desire to learn assembler, but have you really "mastered most other languages"? What about Swift, Rust or Go? Or, to widen your horizons a little more, have you looked at any non-Algol type languages. What about Prolog, Forth, Lisp, or (my favourite) Smalltalk? You can learn a lot from these more esoteric languages. Or, getting back to the Algol family, have you tried Eiffel, Oberon, or Ada?

There's a lot more interesting stuff out there than just C, C++, C#, or Java. Not to mention BASIC ( I said DON"T MENTION BASIC!).


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sat Sep 12, 2020 2:27 am 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
I learned Assembly as I was writing my dual stage FAT 32 bootloader.
It is really not that hard, just make sure to choose Intel’s syntax (it is easier and looks cleaner). Also I prefer NASM over other assemblers.

_________________
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sat Sep 12, 2020 3:13 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
CrossJava wrote:
I'm 13 and already mastered most of the other languages, now it's time for a challenge.
When I was 13, I learned Pascal and didn't really get it. I'm 30 now, and have been working in C almost exclusively for half my life and I still find new and interesting ways to shaft yourself in it. There is quite an astounding complexity to it, and C is a very simple language. C++ is way more complicated (the only known document more complicated than the C++ standard is the US tax code), and has even more and interesting ways to shaft yourself.

You want a challenge, you can look at functional languages. Personally I like Haskell, but I'm terrible at it. It's the exact opposite of the problem I have with C++. Looking at functional or declarative languages (like Prolog) would also widen your perceptions, instead of remaining in the strictly imperative world. But if you want to learn assembler, take any C program, rewrite all control flow in terms of goto and also remove all logical composition (logical AND and OR operators), and then imagine that with five times the line count, and that is basically assembler.

I learned assembler for Win32, back when I still used Windows on my development machine, and I quickly learned how pointless it all is. Win32 API is defined mostly in terms of functions, so your code will, at least initially, be something like 90% function calls. Those functions are external, there is almost nothing you can do to speed things up. Writing these long lists of function calls in assembler merely introduces human error into the mix. After debugging a program for hours and finding that the problem was one a compiler would have found (mixed up arguments, and one was missing), I dropped the venture. Today I use assembler only for that which is absolutely necessary.

If you are more of a theoretical type, I cannot recommend PowerPC assembler highly enough. It is way better than x86 assembler. But since I suspect you will want to try out your creations, and you are unlikely to have an old PowerMac lying around, that is not really an option. I suppose qemu could help out.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sat Sep 12, 2020 5:35 pm 
Offline
Member
Member

Joined: Fri Nov 22, 2019 5:46 am
Posts: 590
CrossJava wrote:
...now I need another place to learn from that's free and high quality. Thanks! :D -Honest

I don't know the whole internet, but I have never seen a free AND high quality Assembler material. You might use a search engine for "Assembler Linux" or "Assembler Windows". But a good book on Assembler beats all internet texts about Asm I saw so far.

Maybe this thread is helpful:
viewtopic.php?f=13&t=37131

Greetings
Peter


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Sep 13, 2020 2:35 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Well, The Art of Assembly Language is fairly comprehensive - https://www.plantation-productions.com/ ... oATOC.html

It won't give you a full overview of system programming, which you need for OS development, but once you've completed it you should be in a good position to understand the Intel and AMD Programmer's Manuals.

If you want to learn assembler, forget about OS stuff and concentrate on user programs. You need to master these thoroughly before tackling system stuff.


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Sep 13, 2020 11:31 am 
Offline
Member
Member

Joined: Fri Nov 22, 2019 5:46 am
Posts: 590
iansjack wrote:
Well, The Art of Assembly Language is fairly comprehensive - https://www.plantation-productions.com/ ... oATOC.html

But this is about High Level Assembler, which is not what we normally call Assembler.

iansjack wrote:
If you want to learn assembler, forget about OS stuff and concentrate on user programs. You need to master these thoroughly before tackling system stuff.

This seems to me like a good advice. One advantage (among others) of application development is that you get positive results faster.

Greetings
Peter


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Sun Sep 13, 2020 12:35 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
All assemblers provide instructions and control structures above the level provided by pure machine code. HLA is just another example. But the book teaches all the basic concepts of x86 assembler programming needed to understand the processor.

If you want pure machine code you can certainly type in a bunch of hex numbers, but it's not necessarily the best way to learn.


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Tue Nov 10, 2020 7:19 pm 
Offline
Member
Member
User avatar

Joined: Thu Jun 04, 2009 11:12 pm
Posts: 281
Hi CrossJava,
Emu8086 is an easy way to learn 8086 assembly language. The program is a little dated, but it was fun to play around with. Old ROSAsm was a fun way to study win32 assembler and 32bit assembler. You can also play around with SSE and MMX instruction set later, but these are merely details. I must warn that these are *fun* ways to learn. You can do same the same thing in Linux and use gdb as a debugger. The experience is similar.

Some of the assembler programs will get flagged by antivirus as malware. Please do not download them if you are concerned about the warning.

Link:
Emu8086
https://archive.org/details/tucows_3250 ... r_Emulator
RosAsm
https://www.tapatalk.com/groups/rosasm/ ... es-t2.html

Assembly Language Tutorials:
Art of Assembly : Art of Assembly Language Programming and HLA by Randall Hyde
https://www.plantation-productions.com/Webster/
http://pacman128.github.io/pcasm/
Assembly language section at PCGPE
http://bespin.org/~qz/pc-gpe/
Flat Assembler manual has a brief introduction. You may check out Fresh IDE and SASM projects.

This is largely focused on x86, which is what I did as a high schooler. It think it might be advantageous to learn about ARM and RISC-V instead in the present era. The principles remain the same. I do not know if this is too advanced for you at this stage but something like this
https://github.com/d0iasm/book.rvemu
might be of some interest to you.

Hope I am of some help.

--Thomas


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Wed Nov 11, 2020 3:51 am 
Offline

Joined: Wed Sep 02, 2020 3:09 am
Posts: 20
iansjack wrote:
Not wishing to detract from your desire to learn assembler, but have you really "mastered most other languages"? What about Swift, Rust or Go? Or, to widen your horizons a little more, have you looked at any non-Algol type languages. What about Prolog, Forth, Lisp, or (my favourite) Smalltalk? You can learn a lot from these more esoteric languages. Or, getting back to the Algol family, have you tried Eiffel, Oberon, or Ada?

There's a lot more interesting stuff out there than just C, C++, C#, or Java. Not to mention BASIC ( I said DON"T MENTION BASIC!).


You still recommend a BASIC language in 2020? Cool.


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Wed Nov 11, 2020 5:55 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
I said "DON'T MENTION BASIC".


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Wed Nov 11, 2020 11:22 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
iansjack wrote:
I said "DON'T MENTION BASIC".

10 print "DON'T MENTION BASIC"
20 print "MENTION BASIC ANYWAY"
30 goto 10

That's as far as I understand the language.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Wed Nov 11, 2020 11:35 am 
Offline
Member
Member

Joined: Fri Nov 22, 2019 5:46 am
Posts: 590
I don't think Basic is THAT bad. (OK, I must admit it isn't great either.) VisualBasic .NET (and I think Gambas) are OOP now and don't have line numbers anymore. And Goto is used rarely (and it exists in C, too).

One really bad aspect about Basic (and Logo, too) is that it isn't very standarized or compatible. Yes, there are Basic and Logo standards. But many implementations don't follow these standards. So if you write code for one system, you can throw it away when you change the system. There were GW Basic, QBasic, Visual Basic etc...

To say something on-topic:
I think Thomas gave some good links for learning Assembler.

Greetings
Peter


Top
 Profile  
 
 Post subject: Re: Places to learn Assembly?
PostPosted: Fri Nov 13, 2020 12:44 pm 
Offline

Joined: Thu Sep 10, 2020 1:32 pm
Posts: 5
I learned assembly a few years ago at a similar age (One bit of advice is you never have fully mastered a language, much less multiple). To he honest I mainly learned assembly through trial and error, through Linux, DOS, and bootloaders. So personally I find the best way to learn is some basic information on assembly and computer architecture, NASM, and time.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 39 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