home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
format
/
2m30src.exe
/
2MBOOTDD.INC
< prev
next >
Wrap
Text File
|
1995-03-06
|
4KB
|
88 lines
;┌───────────────────────────────────────────────────────────────────┐
;│ │
;│ 2MBOOTDD 3.0 - (C) 1993-1995 Ciriaco García de Celis. │
;│ │
;│ Con código del sector de arranque para discos DD. │
;│ │
;└───────────────────────────────────────────────────────────────────┘
CLI
XOR AX,AX
MOV SS,AX
MOV SP,7C00h ; SS:SP inicializado
MOV AX,07C0h
PUSH AX
PUSH AX
POP DS
POP ES
MOV SI,0000h
MOV DI,0200h
MOV CX,0100h
CLD
REP MOVSW ; auto-reubicar este código
MOV AX,07E0h
PUSH AX
PUSH AX
PUSH AX
POP DS
POP ES
MOV BX,DS:[68] ; constante de reubicación
LEA AX,[BX+OFFSET boot_inidd - OFFSET _BootDDPrg]
PUSH AX
RETF ; saltar a boot_inidd reubicado
boot_inidd: STI
MOV BX,DS:[68] ; constante de reubicación
PUSH BX ; *
LEA BX,[BX+OFFSET info_txtdd - OFFSET _BootDDPrg]
CALL printdd
MOV AH,0
INT 16h ; esperar por una tecla
POP BX ; *
LEA BX,[BX+OFFSET crlf_txtdd - OFFSET _BootDDPrg]
CALL printdd
XOR AX,AX
MOV ES,AX
MOV BX,7C00h ; ES:BX = 0000:7C00
MOV AX,0201h ; leer un sector
MOV CX,0001h ; el sector 1 del cilindro 0
MOV DX,0080h ; y cabezal 0 del disco duro
PUSH ES
PUSH BX
INT 13h ; cargar tabla de particiones
JNC rd_okdd
CMP AH,11h ; ¿error ECC corregido?
JNE err_bootdd
rd_okdd: CMP WORD PTR ES:[7DFEh],0AA55h
JNE err_bootdd
XOR AX,AX
MOV DS,AX
RETF ; ejecutar tabla de particiones
err_bootdd: MOV BX,DS:[68]
LEA BX,[BX+OFFSET noboot_txtdd - OFFSET _BootDDPrg]
CALL printdd
MOV AX,40h
MOV DS,AX
MOV WORD PTR DS:[72h],1234h ; evitar chequeo memoria
MOV AH,0
INT 16h ; esperar tecla
DB 0EAh
DW 0, 0FFFFh ; jmp ffff:0000
printdd: MOV AL,[BX]
AND AL,AL ; carácter 0: fin del mensaje
JNZ print_cardd
RET
print_cardd: PUSH BX
MOV AH,0Eh
MOV BX,7
INT 10h ; imprimir carácter
POP BX
INC BX
JMP printdd
info_txtdd DB 13,10,"2M 3.0",13,10
DB " - Disquete DD: Pulsa una tecla para botar del disco duro...",13,10
DB " - DD diskette: Press any key to boot from your hard disk...",0
noboot_txtdd DB " ¡Error!: Pulsa una tecla - Press any key...",0
crlf_txtdd DB 13,10,10,0