Assembler structure language code lines name of the Instruction parameters of the command

Files Recovery Software
Home Contact Details Customer Support Download Demo Products  

 
 

Assembler structure

In assembly language code lines have two parts, the first one is the name of the Instruction which is to be executed, and the second one are the parameters of the command. For example:

ADD ah, bh

Here "ADD" is the command to be executed; in this case an addition, and "ah" as well as "bh" are the parameters.

The name of the Instructions in language is made up of two, three or four letters. These Instructions are also called mnemonic names or operation codes, since they represent a function the processor will perform. There are some commands which do not require parameters for their operation, as well as others that only require just one parameter.

Sometimes Instructions are used as follows:

ADD al,[170]

The brackets in the second parameter indicate to us that we are going to work with the content of the memory cell number 170 and not with the 170 value; this is known as direct direction.

Now we are ready to code for our first program with the help of debug. We are going to create a program that works to illustrate what we have been seeing, and what we will do is to add two values that we will directly introduce into the program.

The first step is to initiate the Debug, this step only consists of typing debug <Enter> on the operative system prompt.

To assemble a program on the Debug, the "a" (assemble) command is used. When this command is used, the address where you want the assembling to begin can be given as a parameter, if the parameter is omitted the assembling will be initiated at the locality specified by CS:IP, usually 0100h, which is the locality where programs with .COM extension must be initiated. And it will be the place we will use since only Debug can create this specific type of programs.

Even though at this moment it is not necessary to give the "a" command a parameter, it is recommendable to do so to avoid problems once the CS:IP Registers are used, therefore we type:

-a0100 <Enter>

When this is done something like this will appear on the screen: 0C1B:0100 and the cursor is positioned to the right of these numbers, note that the first four digits, in hexadecimal system, can be different, but the last four must be 0100, since it is the address we indicated as a begin. Now we can introduce the Instructions:

0C1B:0100 mov ax,0002; puts the 0002 value on the ax register
0C1B:0103 mov bx,0004; puts the 0004 value on the bx register
0C1B:0106 add ax,bx; the content of bx is added to the content of ax
0C1B:0108 int 20; provoques the termination of the program.
0C1B:010A

Previous page

page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20

 
 

page 21 | 22 | 23 | 24 | 25 | 26

Next page
 
 
Data Recovery Book
 
Chapter 1 An Overview of Data Recovery
Chapter 2 Introduction of Hard Disks
Chapter 3 Logical Approach to Disks and OS
Chapter 4 Number Systems
Chapter 5 Introduction of C Programming
Chapter 6 Introduction to Computer Basics
Chapter 7 Necessary DOS Commands
Chapter 8 Disk-BIOS Functions and Interrupts Handling With C
Chapter 9 Handling Large Hard Disks
Chapter 10 Data Recovery From Corrupted Floppy
Chapter 11 Making Backups
Chapter 12 Reading and Modifying MBR with Programming
Chapter 13 Reading and Modifying DBR with Programming
Chapter 14 Programming for “Raw File” Recovery
Chapter 15 Programming for Data Wipers
Chapter 16 Developing more Utilities for Disks
Appendix Glossary of Data Recovery Terms
 
 
Pro Data Doctor

Home

Products

Contact Details

Customer Support

Download Demo

Terms and Conditions

 
Pro Data Doctor