|The 8086 was the
sucessor to the 8080, from beginnings similar to the Z80, the 8086 was
designed to set a foot into the 16 bit world!
In a 40 pin form and with segments to allow it to break out of the limits of a 16 bit address bus, the 8086 was the competitor to the 68000.... and while inferior in some ways - it was set to dominate the computing industry, blasting all it's rivals away, killing mighty giants like the PowerPC, the Sony CELL and even the ITANIUM! - only the highly efficient ARM processor today has managed to stand up to it's power!
Lets take a look at the beginnings of the 8086, and we'll also look a little at what was added to this chip, in the modern systems we use today!
In these tutorials we'll be looking at MS-DOS PC's, the WonderSwan and PC-98
|If you want to learn 8086 get the Cheatsheet! it has all the 8086 commands, It will help you get started with ASM programming, and let you quickly look up commands when you get confused!|
be using USAM as our assenbker for these tutorials
You can get the source and documentation for UASM from the official website HERE
probably think 64 kilobytes doesn't sound much when a small game now
takes 8 gigabytes, but that's 'cos modern games are sloppy,
inefficient, fat and lazy - like the basement dwelling losers
who wrote them!!!
6502 code is small, fast, and super efficient - with ASM you can do things in 1k that will amaze you!
will use a symbol to denote a hexadecimal number, some use $FF or #FF
or even 0x, but this guide uses & - as this is how hexadecimal
represented in CPC basic
All the code in this tutorial is designed for compiling with WinApe's assembler - if you're using something else you may need to change a few things!
But remember, whatever compiler you use, while the text based source code may need to be slightly different, the compiled "BYTES' will be the same!
|Digit Value (D)||128||64||32||16||8||4||2||1|
|Our number (N)||1||1||0||0||1||1||0||0|
|D x N||128||64||0||0||8||4||0||0|
|128+64+8+4= 204 So %11001100 = 204 !|
|If you ever get confused, look
at Windows Calculator, Switch to
'Programmer Mode' and it has binary and Hexadecimal view, so
change numbers from one form to another!
If you're an Excel fan, Look up the functions DEC2BIN and DEC2HEX... Excel has all the commands to you need to convert one thing to the other!
|Equivalent Byte value||255||254||253||251||246||236||206||2||1|
|Equivalent Hex Byte Value||FF||FE||FD||FB||F6||EC||CE||2||1|
these number types can be confusing, but don't worry! Your Assembler
will do the work for you!
You can type %11111111 , &FF , 255 or -1 ... but the assembler knows these are all the same thing! Type whatever you prefer in your ode and the assembler will work out what that means and put the right data in the compiled code!
|Mode||Description||Sample Command||Valid Registers||Z80 Equivalent||effective result|
|Register||An 8 or 16 bit registter||-|
|Immediate||A constant value|
|Direct Memory||A fixed location in memory|
|Register indirect||Contents of register||[BX], [BP], [DI], [SI]|
|Base or index||Contents of register plus displacement||d+[BX], d+[BP], d+[DI], d+[SI]|
|Base plus index||Contents of base register plus contents of index register||mov ax, [bx+di]
mov ax, [bx+si]
mov ax, [bp+di]
mov ax, [bp+si]
|Base plus index with
|Sum of base register, index register, and displacement||mov ax, table[bx][di]
mov ax, table[di][bx]
mov ax, table[bx+di]
mov ax, [table+bx+di]
mov ax, [bx][di]+table
|IO Port Addressing|