16 bit x86 assembly language - looking to learn it

Untitledone

[H]ard|DCer of the Month - April 2012
Joined
Feb 28, 2011
Messages
1,486
Hello there seasoned programmers, I am looking to learn 16 bit x86 assembly language. I would like some web sites or other info that can help me a long. I have a little experience with 8 bit PIC microcontroller assembly language programming so I should not be completely overwhelmed. The reason I want to lean this specificly is to modify and create custom BIOS rom's. Any information is much appreciated!
 
Here's an awesome book on x86 programming:

[ame="http://www.amazon.com/Assembly-Language-Step---Step-Programming/dp/0470497025/ref=sr_1_1?s=books&ie=UTF8&qid=1308111614&sr=1-1"]Amazon.com: Assembly Language Step-by-Step: Programming with Linux (9780470497029): Jeff Duntemann: Books@@AMEPARAM@@http://ecx.images-amazon.com/images/I/51O6xQ7nYhL.@@AMEPARAM@@51O6xQ7nYhL[/ame]

It probably won't teach you what you want though. I do think it would be an awesome start, really enjoyed reading it. Great author.
 
If you want to modify or write BIOS code, you'll need to learn machine code, as assembly source for commercial BIOSs generally isn't available. You'll also need access to tons of undocumented information; I/O ports on motherboards, for example, that control microcode updates, boot processes and diagnostic ports. Some of this is standardized, some of it isn't.

When I learned the 8086/8088, I already had a background in onther chips, but I relied on [ame="http://www.amazon.com/8086-Book-Russell-Rector/dp/0931988292"]Amazon.com: The 8086 Book (9780931988295): Russell Rector, George Alexy: Books@@AMEPARAM@@http://ecx.images-amazon.com/images/I/41HEenuAiRL.@@AMEPARAM@@41HEenuAiRL[/ame]. These books are more than 20 years old, but you can find them used for pennies.

Books like [ame="http://www.amazon.com/Peter-Norton-Programmers-Bible-programming/dp/1556155557/"]Amazon.com: The Peter Norton PC Programmer's Bible: The Ultimate Reference to the IBM PC and Compatible Hardware and Systems Software (Microsoft Press programming classic) (9781556155550): Peter Norton, Peter Aitken, Richard Wilton: Books@@AMEPARAM@@http://ecx.images-amazon.com/images/I/31YQjBxSNkL.@@AMEPARAM@@31YQjBxSNkL[/ame] will help you start learning the low-level systems you'll interact with.

To help you catch up to the undocumented stuff, you'll want a book like [ame="http://www.amazon.com/Reversing-Secrets-Engineering-Eldad-Eilam/dp/0764574817/"]Amazon.com: Reversing: Secrets of Reverse Engineering (9780764574818): Eldad Eilam: Books@@AMEPARAM@@http://ecx.images-amazon.com/images/I/51gig3oDcWL.@@AMEPARAM@@51gig3oDcWL[/ame]
along with [ame="http://www.amazon.com/IDA-Pro-Book-Unofficial-Disassembler/dp/1593271786/"]Amazon.com: The IDA Pro Book: The Unofficial Guide to the World's Most Popular Disassembler (9781593271787): Chris Eagle: Books@@AMEPARAM@@http://ecx.images-amazon.com/images/I/51EZ4rj%2BxKL.@@AMEPARAM@@51EZ4rj%2BxKL[/ame].

Seems like you're really jumping into the deep end of the pool, but I hope this helps.

(Wow, looks like [H] swoops in and adds a affiliate tag to any book recommended here. Pretty lame.)
 
Those amazon image insertions are awful.

If you don't mind answering, what sort of BIOSes are looking to write or modify, and what do you want to do?
 
Books like Amazon.com: The Peter Norton PC Programmer's Bible: The Ultimate Reference to the IBM PC and Compatible Hardware and Systems Software (Microsoft Press programming classic) (9781556155550): Peter Norton, Peter Aitken, Richard Wilton: Books will help you start learning the low-level systems you'll interact with.
LOL, I have that book.

Another book I found really handy was the [ame="http://www.amazon.com/Using-Assembly-Language-Programming-Allen/dp/0880228849"]Amazon.com: Using Assembly Language (Programming Series) (9780880228848): Allen L. Wyatt: Books@@AMEPARAM@@http://ecx.images-amazon.com/images/I/61ICwttuqTL.@@AMEPARAM@@61ICwttuqTL[/ame] book. I have the first edition and it's a pretty clear reference and easy to follow. Plus it covers interfacing with various languages.
 
Hey, thanks for the info guys, I will look out next time I hit a book store! I realize that there is a lot of unknows, but there a plenty of people and resources availible for BIOS reverse engineering. I could fumble around with stuff and get results, but I would like to learn the Assembly language before I get to much into it.

Those amazon image insertions are awful.

If you don't mind answering, what sort of BIOSes are looking to write or modify, and what do you want to do?

I plan to do server BIOS's which typically dont have any overclocking which the EVGA SR2 is the only one of its breed. Mostly I am looking for AMD C32/G34 BIOS editing for the time being to help out my folding brothers in arms. I have the AMI BIOS editing tools, and modules extractor/injection. However I need to know what I am looking at once I get the code out. I dont read HEX or machine language too well. I have an x86 assembler/disassembler, but its no use if I dont know the instruction set and things like that. Oh yeah, I have a hex editor too. I have done some research into this, and have played around with some BIOS's but I need to learn the Assembly language to know what it is doing. I can find registers and stuff like that by comparing the operations and where it is writting to. Then get some old hardware and throw it on to see if it works. Worse case senario, I can put in code and see the results to find if I am getting somewhere.
 
Last edited:
Hey not to piss in your cheerios, but don't get ahead of yourself. Reverse engineering a BIOS is not something you are going to do in a few weekends.

See if your boards support EFI, which you'd probably have better luck with.

Not to say you shouldn't try experimenting with this sort of stuff, there is a lot to learn. But don't expect to actually produce a fresh bios for one of these boards, without the datasheets, within the time that the boards are actually useful. Having higher expectations than just "fooling around" is going to get you discouraged.

Mostly I am looking for AMD C32/G34 BIOS editing for the time being to help out my folding brothers in arms.
 
No fresh BIOS needed here. Just a few mods here and there that plenty of BIOS modders can do in a day once the fundamentals are learned. I have no desire to rebuild a 4MB BIOS from scratch. Which is a huge amount of code ( I know, I oppened it in a dissassembler which made me cry a little). The main module is 417KB, which is a much more manageable amount of code, but still many hundreds or thousands of lines of code.

I guess what I am trying to say is, I have progressed far enough that now I just need to learn assembly language to properly edit the code. To paraphrase something I said in the unofficial [H]ardocp IRC: " I can view, edit, and inject code, however what I put in for all I know can change my BIOS menu to a giant pink bunny rabit flipping me off, or something as subtle as SATA port 5 no longer functioning".

To clairify, the mods I want to do are done fairly often on other motherboards by BIOS modders. These guys can spit out modded BIOS's in a few hours (varying based on the complexity of the features wanted). I am only setting the bar very low at first, I only want to add one or two features, and I expect I will take me a week after I have learned 16 bit x86 assembly. Also these boards I am interested in do not have a big following to begin with, so its even rarer for most BIOS modders to have one.

eloj, thank you very much, I have downloaded that book and will begin reading it this weekend! This will help me get started very quickly! To the rest of you all that have been helping me, thank you! I will check out those other books once I have finished the one eloj linked.
 
Back
Top