Language: x86 32-bit Assembly Language
Download Link: https://googledrive.com/host/0BwXeZl7ISTIXTlJpU09UWUZMTGM/
Download Name: Term00-Assembly-DiskCopy.rar
Source Code:
.286
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
stk segment stack
dw 100h
stk ends
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dat segment
;;;;;;;;;;;;;;;;;;;Print out
data_sector_0 db 512 dup(?)
serial_number db 12h,34h,17h,0E5h
str1 db 40 dup ("Lable orginal DISK : Amir__Mehdi$")
str2 db 40 dup ("Serial number orginal DISK : 1234-17E5$")
str3 db 40 dup ("Serial orginal DISK : $")
str4 db 30 dup ("Lable this DISK : $")
str5 db 30 dup ("Serial this DISK : $")
str6 db 30 dup ("--------This floppy disk is $")
str7 db 16 dup ("ORGINAL--------$")
str8 db 18 dup ("UNORGINAL--------$")
;;;;;;;;;;;;;;;;;;;Print out
EEnter db 10,13,'$'
SSpace db 32,'$'
SStar db '*','$'
dat ends
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cod segment 'code'
assume cs:cod,ds:dat,ss:stk
main:
;;;;;;;;;;;;;;;;;;;fill data segment
mov ax,dat
mov ds,ax
;#####################################################
;##################Draw Background####################
;#####################################################
;;;;;;;;;;;;;;;;;;;Clrscr
mov al,25
mov bh,0
mov cx,0000h
mov dx,2580h
mov ah,07h
int 10h
;;;;;;;;;;;;;;;;;;;gotoxy(x,y)
mov bh,0
mov dx,0000h
mov ah,02h
int 10h
;;;;;;;;;;;;;;;;;;;Read sector 0 diskete
mov bx,offset data_sector_0
mov al, 00h ;number drive
mov cx, 01h ;num head
mov dx, 00h ;number sector
int 25h
;#####################################################
;###################Output Data#######################
;#####################################################
;;;;;;;;;;;;;;;;;;;Write str1
mov dx,offset str1
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Enter
mov dx,offset EEnter
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Write str2
mov dx,offset str2
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Enter
mov dx,offset EEnter
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Write str3
mov dx,offset str3
mov ah,09h
int 21h
mov bx,offset serial_number+4
mov byte ptr [bx],'$'
mov dx,offset serial_number
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Enter
mov dx,offset EEnter
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Star
mov dx,offset SStar
mov cx,40
l2 :
mov ah,09h
int 21h
loop l2
;;;;;;;;;;;;;;;;;;;Enter
mov dx,offset EEnter
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Write str4
mov dx,offset str4
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Write sector 0 lable
mov bx,offset data_sector_0+43+11
mov byte ptr [bx],'$'
mov dx,offset data_sector_0+43
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Enter
mov dx,offset EEnter
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Write str5
mov dx,offset str5
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Write sector 0 serial
mov bx,offset data_sector_0+39+4
mov byte ptr [bx],'$'
sub bx,4
mov dx,bx
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Enter
mov dx,offset EEnter
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;gotoxy(x,y)
mov bh,0
mov dx,0E0Eh
mov ah,02h
int 10h
;;;;;;;;;;;;;;;;;;;Write str6
mov dx,offset str6
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Compaire sairal number
mov si,offset data_sector_0+39-1
mov di,offset serial_number+3 +1
mov cx,4h
l3:
inc si
sub di,1
mov ah,[si]
mov bh,[di]
cmp ah,bh
jne l4
loop l3
;;;;;;;;;;;;;;;;;;;Write str7
mov dx,offset str7
mov ah,09h
int 21h
jmp l5
;;;;;;;;;;;;;;;;;;;Write str8
l4: mov dx,offset str8
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Enter
l5: mov dx,offset EEnter
mov ah,09h
int 21h
;;;;;;;;;;;;;;;;;;;Exit of program
mov ah,4ch
int 21h
cod ends
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end main