Wednesday, February 23, 2011

32 Bit addition of two numbers

.model small
.data
m1 db 10,13,'Enter 1st 32bit no: $'
m2 db 10,13,'Enter 2nd 32bit no: $'
m3 db 10,13,'Addition is: $'
n1 dw 0
n2 dw 0
n3 dw 0
n4 dw 0
n5 dw 0
n6 dw 0

16 bit addition

.model small
.data
m1 db 10,13,'Enter 1st no:$'
m2 db 10,13,'Enter 2nd no:$'
m3 db 10,13,'Answer is:$'
a dw 0
b dw 0
c dw 0
.code
mov ax,@data
mov ds,ax

mov ah,09h
lea dx,m1
int 21h

Tuesday, February 22, 2011

Simple Linux Program



This is a program related to addition ,subtraction,Multiplication and division of two number .coding of program is given below .write it on terminal ,then save the file,make executable file using chmode command .
Coding is: 
                                           
echo Enter First Number
read num
echo Enter Second Number
read num1

while true
do
 printf "\t***MENU***\n1.Addition\n2.Subtraction\n3.Multiplication\n4.Division \n5.Exit\n\tEnter your choice:"
read ch

 case $ch in
1) add=`expr $num + $num1`
   echo Addition is $add
   ;;

2) sub=`expr $num - $num1`
   echo Subtraction is $sub
   ;;

3) mul=`expr $num \* $num1`
   echo Multiplication is $mul
   ;;

4) div=`expr $num / $num`
   echo Division is $div
   ;;

Tasm programming

Tasm programming is related to microprocessor ,Microprocessor based on the binary numbers.All operations handle by Microprocessor in form of instructions.First install the tasm then open a file ,write code as given Below and then save it as .asm extension and execute it .


Addition of 8 Bit number:
.model small
.data
m1 db 10,13,'Enter 1st no:$'
m2 db 10,13,'Enter 2nd no:$'
m3 db 10,13,'Answer is:$'
a db 0
b db 0
c db 0
.code
mov ax,@data
mov ds,ax

mov ah,09h
lea dx,m1
int 21h

call accept
mov a,bl

Monday, February 21, 2011

Linux Programming

Basic Of Linux:

Linux is freely distributed implementation of a UNIX like kernel ,the low level core of an operating system.

As Linux is inspired from Unix at most all programs written for UNIX,can be compiled and run on Linux.


Unix was originally written in c and the majority of Unix applications are written in c but c is not the only option available to Linux programming.Programming languages available to the Linux programmer are c,c++,FORTRAN,icon,java,javascript,Lisp,sql,Borne shell.