Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:58
                                                             Page     1-1


				;       BOOT - IBM hard disk boot record       
				      6/8/82
				;
				;
				; This is the standard boot record that will be
				 shipped on all hard disks. It contains:
				;
				; 1. Code to load (and give control to) the boo
				t record for 1 of 4 possible
				;    operating systems.
				;
				; 2. A partition table at the end of the boot r
				ecord, followed by the required signature.
				;
				;
 0000				_data   segment public
				        assume  cs:_data,ds:_data
				
 0600				        org 600h
				
 0600  FA			        cli             ;no interrupts for now
 0601  33 C0			        xor ax,ax
 0603  8E D0			        mov ss,ax
 0605  BC 7C00			        mov sp,7c00h    ;new stack at 0:7c00
 0608  8B F4			        mov si,sp       ;where this boot record
				 starts - 0:7c00
 060A  50			        push ax
 060B  07			        pop es          ;seg regs the same
 060C  50			        push ax
 060D  1F			        pop ds
 060E  FB			        sti             ;interrupts ok now
 060F  FC			        cld
 0610  BF 0600			        mov di,0600h    ;where to relocate this
				 boot record to
 0613  B9 0100			        mov cx,100h
 0616  F2/ A5			        repnz movsw     ;relocate to 0:0600
				;       jmp entry2
 0618  EA			        db   0eah
 0619  061D R 0000		        dw   $+4,0
 061D				entry2:
 061D  BE 07BE R		        mov si,offset tab      ;partition table
 0620  B3 04			        mov bl,4        ;number of table entrie
				s
 0622				next:
 0622  80 3C 80			        cmp byte ptr[si],80h  ;is this a bootab
				le entry?
 0625  74 0E			        je boot         ;yes
 0627  80 3C 00			        cmp byte ptr[si],0    ;no, is boot indi
				cator zero?
 062A  75 1C			        jne bad         ;no, it must be x"00" o
				r x"80" to be valid
 062C  83 C6 10			        add si,16       ;yes, go to next entry
 062F  FE CB			        dec bl
 0631  75 EF			        jnz next
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:58
                                                             Page     1-2


 0633  CD 18			        int 18h         ;no bootable entries - 
				go to rom basic
 0635				boot:
 0635  8B 14			        mov dx,[si]     ;head and drive to boot
				 from
 0637  8B 4C 02			        mov cx,[si+2]   ;cyl, sector to boot fr
				om
 063A  8B EE			        mov bp,si       ;save table entry addre
				ss to pass to partition boot record
 063C				next1:
 063C  83 C6 10			        add si,16       ;next table entry
 063F  FE CB			        dec bl          ;# entries left
 0641  74 1A			        jz tabok        ;all entries look ok
 0643  80 3C 00			        cmp byte ptr[si],0    ;all remaining en
				tries should begin with zero
 0646  74 F4			        je next1        ;this one is ok
 0648				bad:
 0648  BE 068B R		        mov si,offset m1 ;oops - found a non-ze
				ro entry - the table is bad
 064B				msg:
 064B  AC			        lodsb           ;get a message characte
				r
 064C  3C 00			        cmp al,0
 064E  74 0B			        je  hold
 0650  56			        push si
 0651  BB 0007			        mov bx,7
 0654  B4 0E			        mov ah,14
 0656  CD 10			        int 10h         ;and display it
 0658  5E			        pop si
 0659  EB F0			        jmp msg         ;do the entire message
				;
 065B  EB FE			hold:   jmp hold        ;spin here - nothing mo
				re to do
 065D				tabok:
 065D  BF 0005			        mov di,5        ;retry count
 0660				rdboot:
 0660  BB 7C00			        mov bx,7c00h    ;where to read system b
				oot record
 0663  B8 0201			        mov ax,0201h    ;read 1 sector
 0666  57			        push di
 0667  CD 13			        int 13h         ;get the boot record
 0669  5F			        pop di
 066A  73 0C			        jnc goboot      ;successful - now give 
				it control
 066C  33 C0			        xor ax,ax       ;had an error, so
 066E  CD 13			        int 13h         ;recalibrate
 0670  4F			        dec di          ;reduce retry count
 0671  75 ED			        jnz rdboot      ;if retry count above z
				ero, go retry
 0673  BE 06A3 R		        mov si,offset m2 ;all retries done - pe
				rmanent error - point to message,
 0676  EB D3			        jmp msg          ;go display message an
				d loop
 0678				goboot:
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:58
                                                             Page     1-3


 0678  BE 06C2 R		        mov si,offset m3 ;prepare for invalid b
				oot record
 067B  BF 7DFE			        mov di,07dfeh
 067E  81 3D AA55		        cmp word ptr [di],0aa55h ;does the boot
				 record have the
				                                   ;    require
				d signature?
 0682  75 C7			        jne msg         ;no, display invalid sy
				stem boot record message
 0684  8B F5			        mov si,bp       ;yes, pass partition ta
				ble entry address
 0686  EA			        db 0eah
 0687  7C00 0000		        dw 7c00h,0
				
				include fdisk5.cl1
			     C	; fdisk5.cl1 
			     C	
			     C	
			     C	;_______________________
			     C	
 068B  49 6E 76 61 6C 69     C	m1: DB    "Invalid partition table",0
       64 20 70 61 72 74     C	
       69 74 69 6F 6E 20     C	
       74 61 62 6C 65 00     C	
			     C	
			     C	;_______________________
			     C	
 06A3  45 72 72 6F 72 20     C	m2: DB    "Error loading operating system",0
       6C 6F 61 64 69 6E     C	
       67 20 6F 70 65 72     C	
       61 74 69 6E 67 20     C	
       73 79 73 74 65 6D     C	
       00                    C	
			     C	
			     C	;_______________________
			     C	
 06C2  4D 69 73 73 69 6E     C	m3: DB    "Missing operating system",0
       67 20 6F 70 65 72     C	
       61 74 69 6E 67 20     C	
       73 79 73 74 65 6D     C	
       00                    C	
				
 07BE				        org 7beh
 07BE				tab:                    ;partition table
 07BE  0000 0000		        dw 0,0          ;partition 1 begin
 07C2  0000 0000		        dw 0,0          ;partition 1 end
 07C6  0000 0000		        dw 0,0          ;partition 1 relative s
				ector (low, high parts)
 07CA  0000 0000		        dw 0,0          ;partition 1 # of secto
				rs (low, high parts)
 07CE  0000 0000		        dw 0,0          ;partition 2 begin
 07D2  0000 0000		        dw 0,0          ;partition 2 end
 07D6  0000 0000		        dw 0,0          ;partition 2 relative s
				ector
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:58
                                                             Page     1-4


 07DA  0000 0000		        dw 0,0          ;partition 2 # of secto
				rs
 07DE  0000 0000		        dw 0,0          ;partition 3 begin
 07E2  0000 0000		        dw 0,0          ;partition 3 end
 07E6  0000 0000		        dw 0,0          ;partition 3 relative s
				ector
 07EA  0000 0000		        dw 0,0          ;partition 3 # of secto
				rs
 07EE  0000 0000		        dw 0,0          ;partition 4 begin
 07F2  0000 0000		        dw 0,0          ;partition 4 end
 07F6  0000 0000		        dw 0,0          ;partition 4 relative s
				ector
 07FA  0000 0000		        dw 0,0          ;partition 4 # of secto
				rs
 07FE  55 AA			signa   db 55h,0aah     ;signature
				
 0800				_data   ends
				        end
Microsoft (R) Macro Assembler Version 5.10                  2/14/25 23:44:58
                                                             Symbols-1


Segments and Groups:

                N a m e         	Length	 Align	Combine Class

_DATA  . . . . . . . . . . . . .  	0800	PARA	PUBLIC	

Symbols:            

                N a m e         	Type	 Value	 Attr

BAD  . . . . . . . . . . . . . .  	L NEAR	0648	_DATA
BOOT . . . . . . . . . . . . . .  	L NEAR	0635	_DATA

ENTRY2 . . . . . . . . . . . . .  	L NEAR	061D	_DATA

GOBOOT . . . . . . . . . . . . .  	L NEAR	0678	_DATA

HOLD . . . . . . . . . . . . . .  	L NEAR	065B	_DATA

M1 . . . . . . . . . . . . . . .  	L NEAR	068B	_DATA
M2 . . . . . . . . . . . . . . .  	L NEAR	06A3	_DATA
M3 . . . . . . . . . . . . . . .  	L NEAR	06C2	_DATA
MSG  . . . . . . . . . . . . . .  	L NEAR	064B	_DATA

NEXT . . . . . . . . . . . . . .  	L NEAR	0622	_DATA
NEXT1  . . . . . . . . . . . . .  	L NEAR	063C	_DATA

RDBOOT . . . . . . . . . . . . .  	L NEAR	0660	_DATA

SIGNA  . . . . . . . . . . . . .  	L BYTE	07FE	_DATA

TAB  . . . . . . . . . . . . . .  	L NEAR	07BE	_DATA
TABOK  . . . . . . . . . . . . .  	L NEAR	065D	_DATA

@CPU . . . . . . . . . . . . . .  	TEXT  0101h		
@FILENAME  . . . . . . . . . . .  	TEXT  fdboot		
@VERSION . . . . . . . . . . . .  	TEXT  510		


    132 Source  Lines
    132 Total   Lines
     21 Symbols

  47464 + 257923 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors
