-
Notifications
You must be signed in to change notification settings - Fork 0
/
mbr_bs.asm
110 lines (110 loc) · 2.53 KB
/
mbr_bs.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
MbrAndBr proc
mov ah,2
mov bh,3
mov dx,2500h
int 10h
push 0b800h
pop es
mov di,50+9*160
lea si,Tabl1
mov ah,0ah
mov cx,30
OOP__1:
lodsb
stosw
loop OOP__1
add di,100
mov cx,30
lea si,Tabl2
OOP__2:
lodsb
stosw
loop OOP__2
add di,100
mov cx,30
lea si,Tabl3
OOP__3:
lodsb
stosw
loop OOP__3
add di,100
mov cx,30
lea si,Tabl4
OOP__4:
lodsb
stosw
loop OOP__4
add di,100
mov cx,30
lea si,Tabl5
OOP__5:
lodsb
stosw
loop OOP__5
add di,100
mov cx,30
lea si,Tabl6
OOP__6:
lodsb
stosw
loop OOP__6
push cs
pop es
OOOPPP000:
mov ah,0
int 16h
cmp ah,2
jne OOOPPP001
call startmbrread
mov Poscount, -1
mov Filecount, -1
mov Poscountright, -1
mov Filecountright, -1
call ScrMov
call Findright
call Sortdirright
call Findleft
call Sortdir
call Putname
call Putnameright
call Mover
jmp OOOPPP004
OOOPPP001:
cmp ah,3
jne OOOPPP002
call start_read
mov Poscount, -1
mov Filecount, -1
mov Poscountright, -1
mov Filecountright, -1
call ScrMov
call Findright
call Sortdirright
call Findleft
call Sortdir
call Putname
call Putnameright
call Mover
jmp OOOPPP004
OOOPPP002:
cmp ah,4
jne OOOPPP003
call startmbrwrite
jmp OOOPPP004
OOOPPP003:
cmp ah,5
je OOOPPP005
jmp OOOPPP000
OOOPPP005:
call startwrite
OOOPPP004:
call Path
call ScrChg
ret
Tabl1 db '┌────────────────────────────┐'
Tabl2 db '│1. Read MasterBoot Sector. │'
Tabl3 db '│2. Read Boot Sector. │'
Tabl4 db '│3. Write MasterBoot Sector. │'
Tabl5 db '│4. Write Boot Sector. │'
Tabl6 db '└────────────────────────────┘'
MbrAndBr endp