OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 9:02 pm

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: What very good tutorials are out there for Assembly?
PostPosted: Mon Jan 30, 2017 4:40 pm 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
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.
Attachment:
specs.png
specs.png [ 70.17 KiB | Viewed 2858 times ]

_________________
You know your OS is advanced when you stop using the Intel programming guide as a reference.


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Tue Jan 31, 2017 1:31 am 
Offline
Member
Member
User avatar

Joined: Thu Jul 12, 2012 7:29 am
Posts: 723
Location: Tallinn, Estonia
omarrx024 wrote:
Attachment:
specs.png


Thread hijack: what's this theme called?

_________________
Learn to read.


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Tue Jan 31, 2017 7:21 am 
Offline

Joined: Wed Jan 25, 2017 8:16 am
Posts: 23
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.
Attachment:
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...


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Tue Jan 31, 2017 7:28 am 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
dozniak wrote:
omarrx024 wrote:
Attachment:
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


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Tue Jan 31, 2017 7:32 am 
Offline

Joined: Wed Jan 25, 2017 8:16 am
Posts: 23
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...


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Tue Jan 31, 2017 9:19 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 27, 2004 11:00 pm
Posts: 874
Location: WA
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

Quote:
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...)
Quote:
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
Quote:
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)
Quote:
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)
Quote:
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)
Quote:
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

_________________
## ---- ----- ------ Intel Manuals
OSdev wiki


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Tue Jan 31, 2017 3:20 pm 
Offline
Member
Member
User avatar

Joined: Sun Dec 25, 2016 1:54 am
Posts: 204
andrew isn't taking his meds again

_________________
Plagiarize. Plagiarize. Let not one line escape thine eyes...


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Tue Jan 31, 2017 7:49 pm 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
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.


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Wed Feb 01, 2017 12:13 pm 
Offline

Joined: Wed Jan 25, 2017 8:16 am
Posts: 23
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...


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Wed Feb 01, 2017 12:45 pm 
Offline
Member
Member
User avatar

Joined: Thu Jul 12, 2012 7:29 am
Posts: 723
Location: Tallinn, Estonia
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.


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Fri Feb 03, 2017 12:25 pm 
Offline

Joined: Wed Jan 25, 2017 8:16 am
Posts: 23
I mean like a place to learn more Assembly.

_________________
One day in the future... computers will be holograms...


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Fri Feb 03, 2017 12:59 pm 
Offline
Member
Member
User avatar

Joined: Thu Jul 12, 2012 7:29 am
Posts: 723
Location: Tallinn, Estonia
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.

_________________
Learn to read.


Last edited by dozniak on Fri Feb 03, 2017 1:03 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Wed Feb 08, 2017 6:29 pm 
Offline
Member
Member

Joined: Sat Feb 27, 2010 8:55 pm
Posts: 147
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.


Top
 Profile  
 
 Post subject: Re: What very good tutorials are out there for Assembly?
PostPosted: Mon Feb 13, 2017 2:39 am 
Offline
Member
Member
User avatar

Joined: Sun Aug 25, 2013 5:47 pm
Posts: 86
Location: Nebraska, USA
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-fundamental-introduction-to-x86-assembly-programming

These were on the first page of the Google search
Quote:
x86 assembly


If you want to use Intel syntax, you should add this line to the top of every assembly file:
Code:
.intel_syntax noprefix


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

_________________
"Procrastination is the art of keeping up with yesterday."


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 156 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