What very good tutorials are out there for Assembly?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: What very good tutorials are out there for Assembly?

Post by BrightLight »

We all learned from reading manuals and documentation. I have a folder just for all manuals, for reference. Learn to read official documentation; it's the only way to succeed in this field.
specs.png
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: What very good tutorials are out there for Assembly?

Post by dozniak »

omarrx024 wrote:
specs.png
Thread hijack: what's this theme called?
Learn to read.
stevej150
Posts: 23
Joined: Wed Jan 25, 2017 8:16 am

Re: What very good tutorials are out there for Assembly?

Post by stevej150 »

omarrx024 wrote:We all learned from reading manuals and documentation. I have a folder just for all manuals, for reference. Learn to read official documentation; it's the only way to succeed in this field.
specs.png
Is that macOS (Sierra) or OS X (Yosemite, El Capitan or earlier)? Is it a Linux distro based on OS X?

You've learned from Intel Manuals then? I thought you just searched on Google randomly. Let me try it out then.
One day in the future... computers will be holograms...
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: What very good tutorials are out there for Assembly?

Post by Octacone »

dozniak wrote:
omarrx024 wrote:
specs.png
Thread hijack: what's this theme called?
Looks like Ubuntu with OS X (now macOS) El Capitan Transformation Pack. Let me tell you, it sucks. So many bugs in my opinion, doesn't mimic the look of OS X enough. It is okay for older Ubuntu releases but doesn't look good on 16.10.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
stevej150
Posts: 23
Joined: Wed Jan 25, 2017 8:16 am

Re: What very good tutorials are out there for Assembly?

Post by stevej150 »

So I should read all these pages and I'll be able to make a good OS? This Intel documentation? What should I choose? Combined documentation? 9 PDF files? Or the 3 files? Do they all have the same content? Do they really teach you more about Assembly then? I don't see any programming much. It doesn't look like one of those things when they explain about the mov instruction (not that I don't know what mov is. I do know what it is. It moves something to register).

They don't really have mov ah, 1000 in there or anything.

Is the Intel manual good? The programming manual with lots of volumes? IA-32 x64 documentation? Is it good to learn more?

By the way, that doesn't really look like OS X because it should have Macintosh HD as the hard disk.
One day in the future... computers will be holograms...
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: What very good tutorials are out there for Assembly?

Post by JAAman »

stevej150 wrote:So I should read all these pages and I'll be able to make a good OS?
yes, I would read them all, but most importantly for learning about the instructions, is volume 2 (which describes each instruction in detail)
as for the other things, the first ~6 chapters or so of volume 3 are very important, definitely read them all, but you will probably need to read them (or sections of them) more than once before you properly understand them
This Intel documentation? What should I choose? Combined documentation? 9 PDF files? Or the 3 files?
both have advantages, but I would stick with the 3 volume set myself (unless you want to buy them in book form...)
Do they all have the same content?
the 1-book set, the 3-book set and the 9-book set all contain the same thing, its just how many different books its divided into (its too much information to fit in fewer than 9 physical books, but the PDFs can be larger
Do they really teach you more about Assembly then? I don't see any programming much.
volume 3 teaches you how to control the CPU (it doesn't give code, it gives information: if you can't turn information into code yourself, then OSdev isn't for you)
It doesn't look like one of those things when they explain about the mov instruction
information on the mov instruction would be found in the instruction set reference (book 2) under 'mov' (all the instructions are listed in alphabetical order, or you can look in the table of contents for the list of them all)
They don't really have mov ah, 1000 in there or anything.
yes they do, but its under "mov"... all forms of mov are there (for that instruction, you will want the general purpose mov instruction)
Is the Intel manual good? The programming manual with lots of volumes? IA-32 x64 documentation? Is it good to learn more?
yes, very much, it is the only thing that really teaches it properly, but you have to be ready to work hard at learning because this is not an easy subject to learn properly
User avatar
dchapiesky
Member
Member
Posts: 204
Joined: Sun Dec 25, 2016 1:54 am
Libera.chat IRC: dchapiesky

Re: What very good tutorials are out there for Assembly?

Post by dchapiesky »

andrew isn't taking his meds again
Plagiarize. Plagiarize. Let not one line escape thine eyes...
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: What very good tutorials are out there for Assembly?

Post by BrightLight »

dozniak wrote:Thread hijack: what's this theme called?
MacBuntu transformation pack.
octacone wrote:It is okay for older Ubuntu releases but doesn't look good on 16.10.
I'm on Ubuntu 16.04.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
stevej150
Posts: 23
Joined: Wed Jan 25, 2017 8:16 am

Re: What very good tutorials are out there for Assembly?

Post by stevej150 »

Everyone here is insane and I like it! How can you read 7000 pages by the way?
One day in the future... computers will be holograms...
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: What very good tutorials are out there for Assembly?

Post by dozniak »

stevej150 wrote:How can you read 7000 pages by the way?
Start page-by-page, when you get the idea and have a list of cross-references - go to necessary pages directly.
Learn to read.
stevej150
Posts: 23
Joined: Wed Jan 25, 2017 8:16 am

Re: What very good tutorials are out there for Assembly?

Post by stevej150 »

I mean like a place to learn more Assembly.
One day in the future... computers will be holograms...
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: What very good tutorials are out there for Assembly?

Post by dozniak »

stevej150 wrote:I mean like a place to learn more Assembly.
Assembly is very simple. Assembly language represents operations of the CPU in mnemonic form.

There is a limited set of operations in Load/Store, ALU, FPU, Vector Instruction Units and Machine Control. In each category there's a limited observable number of basic instructions that you HAVE to know to write any program, and more obscure but USEFUL instructions which are not required but nice to know.

Look at the CPU schematic - Load/Store unit concerns with sending data between CPU registers and main memory, ALU performs arithmetic operations (add, sub, mul, div, bit shifts), FPU performs arithmetic and trigonometric operations on floating point numbers (add, sub, mul, div, pow, sin/cos/tan/etc), VIUs perform special "multimedia" or SIMD operations - one command usually operates on 2 or more operands, it implements the same functions as ALU plus some additional like "add with saturation" or "group all bytes in certain positions in multiple arguments into bytes in single register, with some combining logic" - you most probably will not need those right away to start programming. Machine Control commands are used to change the state of CPU and surrounding machinery - e.g. switching to protected mode, controlling cache lines etc. They are very CPU-specific, and you can hold them off a bit.

Start with Load/Store and ALU, and work your way from there.

It really helps to use an emulator like bochs - it has a debugging command line where you can step instruction-by-instruction, so write some stuff, run it in bochs or gdb and see how it changes the state of registers and memory.

Practice makes perfect.

The time you've spent asking how to learn assembly (that was about 2-3 weeks already) you could've easily learned enough assembly to write your simple bootloader.
Last edited by dozniak on Fri Feb 03, 2017 1:03 pm, edited 2 times in total.
Learn to read.
azblue
Member
Member
Posts: 147
Joined: Sat Feb 27, 2010 8:55 pm

Re: What very good tutorials are out there for Assembly?

Post by azblue »

The first few tutorials I find when googling "assembly language tutorial" look usable enough. If you're running in DOS or a DOS emulator Ralf Brown's Interrupt List will be helpful too.
User avatar
ScropTheOSAdventurer
Member
Member
Posts: 86
Joined: Sun Aug 25, 2013 5:47 pm
Location: Nebraska, USA

Re: What very good tutorials are out there for Assembly?

Post by ScropTheOSAdventurer »

I think we should bear in mind that in general there are two different flavors of assembly: Intel and AT&T. For the OP, I am assuming you are using GCC.

This tutorial covers basic Intel Syntax: http://www.cs.virginia.edu/~evans/cs216/guides/x86.html
This one is for AT&T syntax: https://www.nayuki.io/page/a-fundamenta ... rogramming

These were on the first page of the Google search
x86 assembly
If you want to use Intel syntax, you should add this line to the top of every assembly file:

Code: Select all

.intel_syntax noprefix


If you want to use AT&T, do this line instead:

Code: Select all

.att_syntax
"Procrastination is the art of keeping up with yesterday."
Post Reply