Wednesday, March 19, 2014

MPP experiment 6

EXP6-part 1
Programme to transfer string from ds to es
.model small
.stack 10h
data segment
array db 02h, 04h , 06h, 07h , 10h
array_cpy db 10 dup (?)
data ends
code segment
assume cs:code,ds:data
start :
                                mov ax,data
                                mov ds,ax
                                mov es,ax
                                xor ax,ax
                                mov si,offset array
                                mov di,offset array_cpy
                                mov cx,04h
                       rep movsb
                                mov ax,4c00h
                                int 21h
code ends
        end start
EXP 6-B
Programme to swap a string
.model small
.stack 10h
data segment
        array db 01h, 02h, 03h, 04h, 05h
        array_rev db 5 dup (?)
data ends
code segment
        assume cs:code,ds:data
        start :
                                mov ax,data
                                mov ds,ax
                                mov es,ax
                                xor ax,ax
                                mov si,offset array
                                mov di, offset array + 04h
                                mov cx,02h
        repeat : mov al,[si]
                                xchg al,[di]
                                xchg al,[si]
                                inc si
                                dec di
                                loop repeat
                                mov ax,4c00h
                                int 21h
code ends
        end start
Exp6c
Programme to serch an element in a string
Algorithm: Linear Search
.model small
.stack 10h
data segment
        array db 01h, 02h, 03h, 04h, 05h
        msg1 db 13,10, "KEY NOT FOUND$"
        msg2 db 13,10, "KEY FOUND$"
data ends
code segment
        assume cs:code,ds:data
        start :
                                mov ax,data
                                mov ds,ax
                                mov es,ax
                                xor ax,ax
                                mov di,offset array
                                mov ax,0700h
                                int 21h ; dos int for accepting an i/p
                                sub al,30h
                                mov cx,05h
                                cld
                      repne scasb ; search a string
                                cmp cx,00h
                                je not_found
                                mov bx,offset array + 04h
                                sub bx,cx ; bx contains the addr of key
                                mov dx,offset msg2
        print : mov ax,0900h
                                int 21h ; dos int for displaying the o/p
                                mov ax,4c00h
                                int 21h
        not_found : mov dx,offset msg1
                                jmp print
code ends
        end start

Here is the link to download algorithms, flowcharts and answers:

Wednesday, March 5, 2014

Tuesday, March 4, 2014

MPP Experiment 4

The download contains both the algorithms and flowcharts along with the answer to Q3. Q1 can be found in techmax/technical and Q2 is fairly easy, so it has been skipped.

CLICK HERE TO DOWNLOAD!

Here are the codes:

SMALLest number:
.model small
.stack 100h
data segment
array db 50h,20h,99h,30h,40h,10h,60h,70h,80h,90h
max db 0ffh
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
xor dl,dl
mov cl,0Ah
lea bx,array
mov al,max
back: cmp al,[BX+DI]
jc skip
mov dl,[BX+DI]
mov al,dl
skip: inc di
dec cl
jnz back
mov max,al
hlt
code ends
end start

LARGEest number:

.model small
.stack 100h
data segment
array db 10h,20h,99h,30h,40h,50h,60h,70h,80h,90h
max db 0
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
xor dl,dl
mov cl,0Ah
lea bx,array
mov al,max
back: cmp al,[BX+DI]
jnc skip
mov dl,[BX+DI]
mov al,dl
skip: inc di
dec cl
jnz back
mov max,al
hlt
code ends
end start

Monday, February 10, 2014

Saturday, February 8, 2014

MPP Experiment 3

16-BIT DIVISION IN 8086

.MODEL SMALL

.STACK 100H

DATA SEGMENT
NUM1 DW 4567H,2345H
NUM2 DW 4111H
QUO DW 2 DUP(0)
REM DW 1 DUP(0)
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV AX,NUM1
MOV DX,NUM1+2
DIV NUM2
MOV QUO,AX
MOV REM,DX
INT 21H
CODE ENDS
END START

INPUT:     Dividend - 23454567,
           Divisor - 4111,
OUTPUT:    AX – 8AC5H (quotient);
           DX – 0952H (reminder);

16-BIT MULTIPLICATION IN 8086

.MODEL SMALL

.STACK 100H

DATA SEGMENT

NUM1 DW 1234H

NUM2 DW 1234H

LSB DW 2 DUP(0)

MSB DW 1 DUP(0)

DATA ENDS

CODE SEGMENT

ASSUME CS:CODE,DS:DATA

START: MOV AX,DATA

MOV DS,AX

MOV AX,NUM1

MOV DX,NUM2

MUL DX

MOV LSB,AX

MOV MSB,DX

HLT

CODE ENDS

END START

INPUT:     NUM1- 1234,
                 NUM2- 1234,
OUTPUT:    AX – 5A90H (LSB);
           DX – 014BH (MSB);

8-BIT DIVISION IN 8086

.model small

.stack 100h

assume cs:code, ds:data

data segment

num1 dw 99h

num2 dw 33h

data ends             

code segment

START: mov ax,data

mov ds,ax

mov ax,num1

mov bx,num2

div bx

int 21h

code ends

end start

INPUT:  NUM1- 99,

              NUM2- 33,

OUTPUT: AX- 0003

8-BIT MULTIPLICATION IN 8086

.model small

.stack 100h

assume cs:code, ds:data

data segment

num1 dw 56h

num2 dw 78h

data ends             

code segment

START: mov ax,data

mov ds,ax

mov ax,num1

mov bx,num2

mul bx

int 21h

code ends

end start

INPUT:  NUM1- 56,
              NUM2- 78,
OUTPUT: AX- 2850

NOTE: The code for 16-bit division is 100% correct and tested. It is very likely that sir might question you about how the num1+2 instruction is executed, so be prepared!!

Here are the algorithms and flowcharts for 16-bit multiplication and 16-bit division codes:

CLICK HERE TO DOWNLOAD!

Tuesday, January 28, 2014

TASM for Windows

Author: Borland
Email: None
Website: http://www.borland.com/
Released: Feb 20 1996
Platform: Windows
Source: www.phatcode.net
Binaries: Yes
Summary:
Turbo Assembler 5 is the last version of the popular assembler by Borland, with both DOS and Windows assemblers.
TASM has full 8088, 8086, 80286, 80386, i486, and Pentium support, as well as interface support for C, C++, Pascal, FORTRAN, and COBOL. A full-screen interactive debugger (Turbo Debugger) is also included.
The download below includes the original install disks for TASM 5.0, along with patches to upgrade to version 5.3.
Note: TASM is no longer sold or supported by Borland. Therefore, I am making it available for download here. If you represent Borland and want this download removed, please contact me.
To get TASM version 5 for 32-bit windows, link on the below link!
(Total size: 5.2MB)

Steps to install TASM for 32-bit:
1) On unzipping the files you'll get a folder named tasm5 which will have the folders:
DISK1
DISK2
DISK3
DOCS
PATCHES
phatcode
2) Copy contents of DISK2 AND DISK3 in the DISK1 folder.
2) Copy the entire tasm5 folder to C:
3) Open folder DISK1 and Run "INSTALL.EXE" as administrator. Press Enter
4) Enter the source drive to use: C
5) Press Enter, it will show you the path for installation.
6) Press Enter and select start installation.
7) It will ask if you wish to create groups and icons, click yes.
8) Congratulations! You're done!
Oh, ignore the rest of the files. TASM 5.3 patch is also available. If you can install it, well and good but it's totally unnecessary.


Steps to install TASM 64-bit:

1. Go to Start, and My Computer. Click on (C:) Local Disk C (or any desired location you want).
2. On the directory, create a folder and name it TASM ( or any name you want). 
3. Download THIS file.
4. Extract the contents of the .zip file.
5. Copy the extracted files to the folder TASM (or to the folder you've made awhile ago). Also, don't forget to extract the DEBUG125.zip to the same folder.
6. Download DOSBOX HERE
8. After installing the DOSBox, run it and type the following lines:

MOUNT E C:\TASM    
E:



If you chose a while ago a custom drive besides the directory of C:

LET X be your drive letter:

MOUNT E X:\TASM
E:


9.Done!!

If nothing works then take the file from me in college via Bluetooth :-P