Category : Files from Magazines
Archive   : PCTJ1285.ZIP
Filename : LANDER.ASM
Output of file : LANDER.ASM contained in archive : PCTJ1285.ZIP
;****************************************************************
; LANDER.ASM *
; LANDER.COM is a program to move the fixed disk heads on the*
; IBM PC/XT (or PC) to the "shipping" cylinder (cylinder 306 on*
; the standard fixed disk). When LANDER displays its closing*
; message, turn off the master power switch to land the heads*
; in a safe position in case the system unit is accidentally*
; moved. *
; WARNING: LANDER may not work properly with "third-party"*
; drives or with "IBM-compatible" systems. *
;****************************************************************
; Written by M. L. Lesser, June 28, 1985
; Assembled with IBM PC Macro Assembler v2.00
; Linked file converted to .COM file with EXE2BIN
CODE SEGMENT PARA PUBLIC 'CODE'
ASSUME CS:CODE, DS:CODE
ORG 100H
LANDER PROC NEAR
JMP DOIT
;Messages:
MESS_1 DB 13,10,'No fixed disks installed',13,10,'$'
MESS_2 DB 13,10,'Fixed disk in landing position'
DB 13,10,'$'
MESS_3 DB 13,10,'Both fixed disks in landing position'
DB 13,10,'$'
MESS_4 DB 13,10,'TURN OFF MASTER POWER SWITCH$'
;Local storage:
OLDINT DD ? ;Original INT 41 vector
PARMS DB 64 DUP(?) ;Substitute parameter table
DOIT:
;Set up temporary drive parameter table:
MOV AX,3541H ;Get and store orginal vector
INT 21H
MOV WORD PTR OLDINT,BX
MOV WORD PTR OLDINT+2,ES
LDS SI,OLDINT ;Source starting address
MOV AX,CS ;Destination starting address
MOV ES,AX
MOV DI,OFFSET PARMS
MOV CX,64 ;Number of bytes to move
CLD ;Move increasing direction
REP MOVSB ;Move them
MOV AX,CS ;Restore DS addressability
MOV DS,AX
;Increase maximum number of cylinders in new table by 16:
MOV AX,16
LEA BX,PARMS
ADD [BX],AX
ADD 10H[BX],AX
ADD 20H[BX],AX
ADD 30H[BX],AX
;Check for existence of hard drive:
MOV AH,11H ;Attempt to recalibrate
MOV DX,80H ; first hard disk
PUSH DX
INT 13H
OR AH,AH ;Was command performed OK?
LEA DX,MESS_1 ;Set up no-drive message and
JNZ ENDIT ; exit if no fixed drives
POP DX
CALL MOVER
;Check for existence of second hard drive:
MOV AH,11H ;Attempt to recalibrate
MOV DX,81H ; second hard disk
PUSH DX
INT 13H
OR AH,AH ;Did it do it OK?
LEA DX,MESS_2 ;One-drive message
JNZ ENDIT ;Exit if no second drive
POP DX
CALL MOVER
LEA DX,MESS_3 ;Two-drive message
ENDIT: MOV AH,09H ;Display "drive" message
INT 21H
LEA DX,MESS_4 ;Display final message
MOV AH,09H
INT 21H
INT 20H ;and quit
MOVER: ;Move to highest track on disk
;Get original drive parameters:
MOV AH,08
PUSH DX
INT 13H
;Install new vector for INT 41:
MOV AX,2541H
LEA DX,PARMS
INT 21H
;Initialize drive parameters with new table:
MOV AH,09
POP DX
PUSH DX
INT 13H
;Move head past highest pre-formatted cylinder:
MOVIT: CLC ;Clear carry flag
ADD CH,1 ;Next cylinder
JNC M2 ;If register overflowed
ADD CL,40H ; increase high bits
M2: MOV AX,0401H ;Move and verify sector
INT 13H
OR AH,AH ;Past end?
JZ MOVIT ;If not, try one more
;Return to shipping cylinder:
CLC
SUB CH,1
JNC M3 ;In case of underflow
SUB CL,40H ; decrease high bits
M3: MOV AX,0401H
INT 13H
;Restore original INT 41 vector:
LDS DX,OLDINT
MOV AX,2541H
INT 21H
;Restore DS addressability:
MOV AX,CS
MOV DS,AX
;Initialize to original drive parameters:
MOV AH,09
POP DX
INT 13H
RET
LANDER ENDP
CODE ENDS
END LANDER
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/