Please browse through this site and pick-up all you can. But if you have trouble understanding anything, that's normal. This is a whole new world.
WHENEVER you want to dive into the code, all you need to do is get your compiler, get your linker, get DOS running (or window's dos box) and Go To The TUTORIAL page.
The tutorial page is setup to explain everything you need to know as you go along.
REMEMBER to set the PATH environmental variable to include your compilier's directory.
If you don't like the style here, there are MANY other tutorials online. See my short list of them. One tutorial there gets you started with the code real quick with minimal explanation. We get the code on quick here as well, but the explanations are thorough.
Email me: bhakta_f@yahoo.com
Please read this intro page, It'll show you the site's structure.
.why learn assembly?
You should know assembly if you're going to be a computer or electrical engineer. Devices which employ Micro Controllers or a SystemOnChip are prevalent. Knowing assembly language is neccesary to fine tune many resource-intensive systems. Though the bulk of an OS will be made with C. Assembly Language is the backbone of computer programming, since the microprocessor takes those finite steps that carry out any computer program. To program with assembly language, you depend upon knowledge of how the machine gets things done.
one operation is to copy a byte from ram into one of the cpu's data registers.
another operation is to add the number 5 to a value in one of the cpu's data registers.
There is alot to learn about PC architecture (intel cpu/ibm AT clone), since they have so many features on the motherboard (and BIOS).
Many high-end colleges have students learn assembly for other processor/systems.
But programming Intel CPUs, in real mode, is easy, and is a great place to start.
Two other processors are MIPS and Motorola 680000.
.Intro
Assembly Language is the way to code a CPU's Machine Instructions. A Cpu's machine instructions, or Opcodes, are binary (numerical) data within memory storage which the CPU seeks out.
Each Opcode has specific meaning to the CPU.
Everything you've ever seen a computer do was achieved through a LONG series of these Opcodes.
For example, Windows makes things very user-friendly, but behind the sceen it handles complex jobs by coordinating immense data structures, but these data structures are maintained by the cpu, whose actions are dictated by it's Opcodes.
When we code, we lay down Opcodes in an order which accomplishes the task.
High Level Languages do the same thing; a C compiler turns your logical C-code into Structured CPU Opcodes.
When we code Assemby, we must provide the logical structure. Our only constraints are those of the HARDWARE.
Back to the CPU! The CPU does 3 things for it's living:
1) FETCH machine code instructions
2) DECODE machine code instructions
3) EXECUTE machine code instructions
The CPU seeks out these instructions in RAM. The CPU has two special registers which pointer to the ram location
from which to FETCH the next machine code instruction. One is called the IP, for Instruction Pointer.
The CPU auto-advances the IP to point to the next Opcode every execution cycle.
Various JUMP instuctions (categorically know as Control-Transfer instructions), Will add or subtract large values from the IP, thereby enabling the CPU to JUMP to a different section of CODE.
The methods of control transfer are vast and are vital to all aspects of programming in ANY language.
The concept of calling Procedures or Functions demonstrates this (in Pascal or C).
All high-level languages are the syntax of the HUMAN-COMPLIER interface, the complier must translate all it's native code into MACHINE INSTUCTIONS.
Let me not mislead you though, Assembly Language IS a Human-Complilier syntax. But the language is not 'high-level'. There is no abstraction. There are no IF's or VAR= VAR * 3. Assembly Language, it's syntax, is meant to communicate as cleary as possibly, which Opcode shall be generated and what variation (if any) will be implemented.
At the CPU, where machine code reigns, all things become clear.
8086:
We're going to learn how to program the 8086.
All Intel compatible 32-bit processors (meaning Pentiums, 80486, AMD's K6, K5, Athlon, etc.) can run in REAL MODE, in which they function as their ancestor, the 8086. This REAL MODE is the realm of DOS, the Disk Operating System.
We will deal with this Real Mode and it's 16-bit instruction set, along with it's style of memory addressing (SEGMENT:OFFSET).
Plus, we will speak of DOS, may we bless his crossing...
In order to make programs, We must understand:
1) Instruction SYNTAX
2) Memory Addressing (Including the CPU's general registers)
3) Use of Compilier and Linker
4) Runtime Environment (Dos or Linux)
-) Learn the 8086's instruction set. Not ALL at once; you'll learn here as you go along.
-) You'll need to know the Binary and Hexadecimal number systems; agian, you'll learn here as you go along. Do study it on your own though. It's important to see the relation between binary digits (bits) and the values the represent.
238
ART HOME
LogicalHIGH - a parent
Domain = SnP