Rev 1635 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1635 | Rev 2010 | ||
---|---|---|---|
Line 192... | Line 192... | ||
192 | ; print one dot |
192 | ; print one dot |
193 | push bx |
193 | push bx |
194 | mov ax,0e2eh ; ah=0eh (teletype), al='.' |
194 | mov ax,0e2eh ; ah=0eh (teletype), al='.' |
195 | xor bh,bh |
195 | xor bh,bh |
196 | int 10h |
196 | int 10h |
- | 197 | pop bx |
|
Line -... | Line 198... | ||
- | 198 | ||
197 | 199 | writesec: |
|
198 | ; convert cluster number to sector number |
200 | ; convert cluster number to sector number |
199 | mov ax,bp ; data cluster to read |
201 | mov ax,bp ; data cluster to read |
200 | sub ax,2 |
202 | sub ax,2 |
201 | xor bx,bx |
203 | xor dx,dx |
202 | mov bl,byte [BPB_SecPerClus+boot_program] |
204 | mov dl,byte [BPB_SecPerClus+boot_program] |
203 | mul bx |
205 | mul dx |
204 | add ax,word [data_start+boot_program] |
- | |
Line 205... | Line -... | ||
205 | pop bx |
- | |
206 | 206 | add ax,word [data_start+boot_program] |
|
207 | writesec: |
207 | |
208 | call conv_abs_to_THS ; convert abs sector (AX) to BIOS T:H:S (track:head:sector) |
208 | call conv_abs_to_THS ; convert abs sector (AX) to BIOS T:H:S (track:head:sector) |
209 | patchhere: |
209 | patchhere: |
210 | mov ah,2 ; ah=2 (read) |
210 | mov ah,2 ; ah=2 (read) |
Line 265... | Line 265... | ||
265 | ; |
265 | ; |
266 | write1st: |
266 | write1st: |
267 | push cs |
267 | push cs |
268 | pop ds |
268 | pop ds |
269 | mov byte [patchhere+1+boot_program], 3 ; change ah=2 to ah=3 |
269 | mov byte [patchhere+1+boot_program], 3 ; change ah=2 to ah=3 |
270 | mov ax,[cluster1st+boot_program] |
270 | mov bp,[cluster1st+boot_program] |
271 | push 1000h |
271 | push 1000h |
272 | pop es |
272 | pop es |
273 | xor bx,bx |
273 | xor bx,bx |
274 | call writesec |
274 | call writesec |
275 | mov byte [patchhere+1+boot_program], 2 ; change back ah=3 to ah=2 |
275 | mov byte [patchhere+1+boot_program], 2 ; change back ah=3 to ah=2 |