Professional Documents
Culture Documents
MASM
Procedure:
start->run->type cmd )
3. In that window change the directry [Where you paste the masm
software]
4.In the command window type the directory name after that change the
directory to 8086(masm) after that type edit
5.After changing directory type edit then you get one window in that window
you can write a program
8.Type:
link filename,,;
[This will create a list file you can see this
inside the masm(8086)software]
Note :
Here we no need to use stack segment so no need to worry about
stack error
8.Type :
9.Type :
n filename.bin
10.Type : wcs:1000
11.Type : g =1000
12. Type
13.Type :
e 1200
to see next output value
PROGRAMS:
Write an alp to display a string manupulation in the monitor
Code segment
Assume cs: code, ds: code
Org 1000h
Mov ah, 09h
Mov dx, 1200h
Int 21h
Mov ah, 4ch
Int 21h
Org 1200h
Db VI micro$
Code ends
End
------------------------------------------------------------------------------------------------------------------
Write an alp to read scan code and character code from a keyboard control
Code
Code segment
Assume cs: code, ds: code
Org 1000h
Mov ah, 0h
Int 16h
Mov si, 1200h
Mov [si], al
Inc si
Mov [si], ah
Mov ah, 4ch
Int 21h
ends
End
-----------------------------------------------------------------------------------------
File manipulation:
File creation
code
segment
assume cs:code,ds:code
org 1000h
mov ax,data
mov ds,ax
mov ah,3ch
mov cx,0000h
mov dx,1200h
int 21h
mov ah,4ch
int 21h
code ends
data segment
org 1200h
db 'vi.asm'
data ends
end
Write an alp to create a directory using dos calls
code segment
assume cs:code,ds:data
org 1000h
mov ax,data
mov ds,ax
mov ah,39h
mov dx,1200h
int 21h
mov ah,4ch
int 21h
code ends
data segment
org 1200h
db 'man'
data ends
end
segment
assume cs:code,ds:code
org 1000h
mov ax,data
mov ds,ax
mov ah,5bh
mov dx,1200h
mov cx,0
int 21h
mov ah,4ch
int 21h
code ends
data segment
org 1200h
db 'e:\man\v.asm'
data ends
end
code
data
segment
assume cs:code,ds:data,es:data
org 1000h
mov ax,data
mov ds,ax
mov es,ax
mov dx,1300h
mov [di],1500h
lea dx,oldname
lea di,newname
mov ah,56h
int 21h
mov ah,4ch
int 21h
ends
segment
org 1300h
oldname db 'vi.txt'
org 1500h
newname db 'service.txt'
data ends
end
File deletion
code
segment
assume cs:code,ds:code
org 1000h
mov ax,data
mov ds,ax
mov ah,41h
mov dx,1200h
int 21h
mov ah,4ch
int 21h
code ends
data segment
org 1200h
db 'vi.asm'
data ends
end
---------------------------------------------------------------------------------------------------------
code
data
data
mov [si],ax
mov ah,40h
lea dx,buffer
mov cx,0050h
mov bx,[si]
int 21h
mov ah,3eh
int 21h
mov ah,4ch
int 21h
ends
segment
org 1300h
filename db 'vi.txt'
org 1400h
buffer db 'vimicro systems'
ends
end
Addition:
code segment
assume cs:code,ds:code
org 1000h
mov ax,1234h
mov bx,1234h
add ax,bx
mov si,1200h
mov [si],ax
mov ah,4ch
int 21h
code ends
end
Result:
e 1200=68
24