Assembly Language of Today

Programming, for all ages and all languages.
Post Reply
html81993
Posts: 2
Joined: Fri May 23, 2008 7:19 pm

Assembly Language of Today

Post by html81993 »

I looked at the required reading on the wiki and saw that I needed to know assembly language. I have a book on the PDP-11s assembly language. If I read that, do you think it will at least give me the basics for starting assembly language?
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post by 01000101 »

I have no idea... but that alone leads me to believe that it's not the beaten path.

I would recommend reading The Art of Assembly (google it), or learn some INTEL syntax assembly through google as well. I'd start making a few applications, like a calculator or something and see if you have the hang of things.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

We are all still learning asm, but for the basic's i found the book "IBM PC Assembly Language and Programming by Peter Abel" very good.

Or a good asm tut for download(if abit old now) is Adam's asm tuts
http://www.programmersheaven.com/downlo ... nload.aspx
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post by bewing »

Yes, the DEC pdp11 had a decent 16bit assembly language. You would learn about 50% of what you need to know by reading that. You would learn more like 70% if you could find a Motorola MC680x0 user's manual.

But there is at least one completely free PC assembly book available on the web. Google for pcasm-book.pdf, or pcasm-book-pdf.zip

It still won't tell you everything about how to program in ASM -- but the way to learn the rest is just to do it. Get the debugging version of bochs, write some code, and singlestep your way through it, to see how all the opcodes and registers work.
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Post by Korona »

IMHO you can easily learn x86 assembly language while writing an os. You have to know the basic general purpose registers and some basic instructions. I guess there are many tutorials covering this. You could start coding a small boot loader or a small realmode kernel or you could use grub and write some assembly code for protected mode. After you know the basics understanding assembly code should not be a problem. If you come across an instruction that you don't know simply look it up in the intel or amd manuals. There are also some tutorials about using assembly on linux. Maybe that is a good introduction into x86 assembly.
html81993
Posts: 2
Joined: Fri May 23, 2008 7:19 pm

Post by html81993 »

I have checked out some of the places you guys have suggested. Once I write some code, how do I assemble it into binary (.exe)?
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

If you use FASM you can simply do this
c:\fasm MyFile.asm MyFile.exe <enter>
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

PDP - 11

Post by DeletedAccount »

If you have access to a PDP - 11 machine , then learning it might help . I have learned PDP - 11 , VAX , CRAY - 1 , CYBER -205 and lots of archaic instuction sets and achitectures to pass the university exams , even though i know very well that they are not going to help me
with anthing practical , It can help you bluff in front of you friends .....

Regards
Sandeep Mathew
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Post by Brendan »

Hi,
html81993 wrote:I have checked out some of the places you guys have suggested. Once I write some code, how do I assemble it into binary (.exe)?
See the documentation for whichever assembler you choose (there's at least 4 good free assemblers for 80x86), and possibly the linker you're using (if any). The assembler's (and/or linker's) documentation should describe command line options that control the output format, with some details on generating a (DOS, 16-bit) "*.exe" and/or a (Windows/PE, 32-bit or 64-bit) "*.exe" (but for OS development you normally need a flat binary file and not a "*.exe")... ;)

For learning assembly language, there's fundamentals (learning hex, boolean logic, the more general concept of a device that reads a stream of bit patterns and does certain actions depending on which bit patterns it reads, etc) that apply to assembly language for all CPU types. Then there's implementation details - which instructions the target CPU support and how they work (and implementation details for things like memory management, protection, timing, etc). On top of that there's the assembler itself - which syntax (e.g. for 80x86 there's "Intel syntax" and "AT&T"), what preprocessor stuff it supports, which instructions it supports, etc.

Learning (one of the many possible variations of) PDP-11s assembly language will help with the fundamentals, but won't help much with anything else...


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply