8086 up programming
Loading of the Tasm software c:\tasm\set it environment variables ->my
computer
Writing the sample program
Write a program for addition of 2
8bit numbers
DS|CS|SS|ES these all are called as assemblies
directories (for defineing these directories the order also same as in the
previous line mentioned otherwise the program will not work even though no
errors in the program)
In this programming we are using 8086
micro processor it doesn’t have any internal memory but it uses (or it
supports) external memory for 1GB
It is having 20 address lines
Model small here which memory model
you are using
Here are generally 4 models small,
medium, compact, large
Small 1CS,1DS
Medium N CS, 1DS
Compact, 1 CS, NDS
Large N CS, NDS
in any program for loading of data
for the program Data Segment and for the source code Code Segment for each segment by default 64KB if any
segment exceeds then it extends for next one more 64Kb extra segment
Total 16(64kbs for each segment
4blocks of 64kbs)
Why we are doing segmentation because
to avoid memory wastage
Data
Code
Stack
Extra segment (optational)
Org 2000h our program which location
to load beginning address of our program
Cec proc (it indicates start of the
sub function i.e. procedure) near (here near means single segment, far means
the previous one extension)
Mov Al,06Hdata in (hexa decimal) here we are having 4 types of registers for
arithmetic
They are AX accumulator register
Bx base register
Cx constant register
Dx debug register
Generally we represent data in BCD
number format which is 4digit number
for example you want to submit data 8 in the form of 08= 0000 1000(If give 8 1000 only 4bits what about the
remaining 4bits )
And one more example here both
supplied data should be same for ex
06(this is 3bit ),33(this is 6bit so
the input data is not matching to avoid we put before 0
Mov Bl,05h data
Add Al,Bl
Hlt for halting of the program if
reach this line then the program is over, here result will get
The above also comes under interrupts
section INT 03h,21 are generally using but we are having 256 interrupts
Cec(instead of cec you mention any
code or name like x,or ramu…) endp it
indicates the end of the procedure
end cec here we are closing whole program and
segments everything total close in c like main function
Running of the program
We will do the compilation 2 ways
tasm turbo assembler, or masm Microsoft assembler
Step: 1 compilations of the program,
while compiling source -> machine language
Tasm
filename.asm ex:-tasm
add.asm here o/p you will get add.obj
Now any error you want to edit ex: -
edit add.asm
Step2:- linking stage here you give
the I/p the above .obj file
Tlink filename.obj for this command you will get .exe file
Step 3:-
Debug filename.exe ex: - add.exe
Now it will ask -rip (register
instruction pointer) give the starting address to exe next instruction you have to give
starting address of the program (for ex: - 2000 or 3000) next‘t’ after execute entatire program exit from
that ‘q’
కామెంట్లు లేవు:
కామెంట్ను పోస్ట్ చేయండి