   About six years ago I started to publish regulary in our@bi-monthily computermagazine. No, I won't make you the same@offer. I not used to write or speak English. I wrote down this@text in English, the way I would have explane it to myself. 
@Anyway. I will send you some of the listings I used in my@columns. The explanation will be tide.
@
@The following listing is the assembly code, a friend (one of our@TRS80 guru's here in Holland) produced. Remember to look for the@name L. Roosendaal, that's the guru I'm talking about. Anyway,@to implement the program and to use it, means you will have to@have this code burn in an EPROM and place this EPROM in the@place of the existing ROM-chips.
@
@This is the code for new ROM's in the Model I.
@I asked my friend to do the following:
@-	Let my 20 Mb harddisk start automathickly every time I@	switch on my TRS80.
@-	If I choose to start with a floppy, so let it be.
@-	If I want to start up in LEVEL II Basic, even the memsize@	question should be there to be answered.
@-	Last but not least. I want 100% compatibality with the@	Model I as is.
@Well he did just that!
@
@Here in our computermagazine I explored the code bit by bit with@our readers. I showed them, where my friend found the space to@make 42 bytes of code fit into the existing Rom-code, without@re-designing the Rom. We found several places were two or three@bytes could be won. But we had to create a 100% compatibel Rom@code. As Tandy created some space in the text (Memorysize became@Memsize and so on) we also created space by making Mem? and R/S@L2. We had to find space in tiding up the existing Rom code made@by Paul Allen en Bill Gates.
@
@We do have our ways here in Holland to use EPROM's in the place@were Tandy placed the ROM's. After that there were still two@things to take account of.
@
@First you should know that the dosses wrote for the TRS80@weren't designed to work with harddisks. So the dosses look for@pdrive tables and so on on the floppydisk.
@We rewrote the BOOT/SYS of Newdos80.
@Here comes the assembly code. I'm sure it won't take must affort@to fix it for TRSDOS. We here in The Netherlands mainly use@Newdos80 on the Model I and III.
@
@00010 ;boot for Newdos harddisk for the TRS-80 model I
@00020 ;written 5-7-1993
@00030 ;by definition we will start on sector 5, head 0 van@cylinder 0.
@00040 ;
@00050 STATUS	EQU	0CFH	;command/status port
@00060 TRACK	EQU	0CDH	;cylinder port
@00070 SECTOR	EQU	0CBH	;sector port
@00080 DATA	EQU	0C8H	;data port
@00090 RDCOMD	EQU	020H	;read one sector command
@00100 DIRGRN	EQU	24H
@00110 START	EQU	0005H
@00120 
@00130 	ORG	5200H
@00140 BEGIN	DI
@00150 	LD	A,DIRGRN	;DIR granule
@00160 	LD	SP,41E0H
@00170 	EXX
@00180 	LD	DE,START	;first sector SYS0
@00190 	LD	HL,5100H	;buffer start
@00200 	EXX
@00210 	LD	HL,51FFH	;buffer start + 255
@00220 LOOP1	CALL	RDBYTE		;read next byte
@00230 	CP	20H
@00240 	JR	NC,ERROR
@00250 	LD	C,A		;record type
@00260 	CALL	RDBYTE
@00270 	LD	B,A		;number of bytes
@00280 	LD	A,C
@00290 	CP 	1		;record type 1 (program@code)
@00300 	JR	Z,RTYP01
@00310 	CP	2
@00320 	JR	Z,RTYP02	;record type 2 (program@entry)
@00330 ;
@00340 ;hier indien commentaar (record types 0, 3 - 20h)00470 ;
@00350 ;
@00360 REMARK	CALL	RDBYTE
@00370 	DJNZ	REMARK
@00380 	JR	LOOP1		;all read
@00390 ;
@00400 ;record type 01 = program code
@00410 ;
@00420 RTYP01	CALL	RADRES		;address in DE
@00430 RTLP01	CALL	RDBYTE
@00440 	LD	(DE),A		;store program data
@00450 	INC	DE		;next RAM address
@00460 	DJNZ	RTLP01
@00470 	JR	LOOP1
@00480 ;
@00490 ;record type 02 = program entry
@00500 ;
@00510 RTYP02	CALL	UPDATE		;adres in DE
@00520 	LD	A,(DE)		;test byte in SYS0
@00530 	CP	0A5H		;10100101 pattern
@00540 	JR	NZ,NOSYS	;error message NOSYS
@00550 	INC	DE		;program entry
@00560 	PUSH	DE		;save DE (entry)
@00570 	EXX			;DE' = sector number
@00580 	LD	E,2		;read pdrive sector
@00590 	EXX
@00600 	LD	L,0FFH		;force to read sector
@00610 	LD	DE,0FF3BH	;Newdos pdrive table
@00620 	LD	B,0DH		;13 bytes of first pdrive
@00630 RPDRIV	CALL	RDBYTE
@00640 	LD	(DE),A
@00650 	INC	DE
@00660 	DJNZ	RPDRIV		;end of read first pdrive
@00670 	CALL	RDBYTE		;skip one byte (nr 14)
@00680 	CALL	RDBYTE		;one byte (nr 15)
@00690 	LD	(DE),A
@00700 	INC	DE
@00710 	CALL	RDBYTE		;last byte pdrive (nr 16)
@00720 	LD	(DE),A
@00730 	INC	DE
@00740 	LD	A,0FE		;first address not to@zero
@00750 	SUB	E
@00760 	LD	(4D04H),DE	;first address to zero
@00770 	LD	(4D07H),A	;number of bytes to zero
@00780 	RET			;execute program
@00790 ;
@00800 ;program load or entry addres in DE
@00810 ;
@00820 RADRES	CALL	RDBYTE
@00830 	DEC 	B		;count one byte
@00840 	LD	E,A		;low address
@00850 	CALL	RDBYTE
@00860 	DEC	B		;count one byte
@00870 	LD	D,A		;high address
@00880 	RET
@00890 ;
@00900 ;ERROR message
@00910 ;
@00920 ERROR	LD	HL,ERRORM	;address of error message
@00930 	JR	DISPHL		;display text (HL)
@00940 NOSYS	LD	HL,NOSYSM
@00950 DISPHL	LD	A,(HL)
@00960 	INC	HL
@00970 	CP	03H		;EOM
@00980 ENDLES	JR	Z,ENDLES
@00990 	CALL	0033H
@01000 	JR	DISPHL		;next byte of message
@01010 ;
@01020 ERRORM	DEFB	1CH		;TOF
@01030 	DEFB	1FH		;CLS
@01040 	DEFM	'Hard disk error'
@01050 	DEFB	03H		;EOM
@01060 NOSYSM	DEFB	1CH		;TOF
@01070 	DEFB	1FH		;CLS
@01080 	DEFM	'No system on hard disk'
@01090 	DEFB	03H		;EOM
@01100 ;
@01110 ;Read byte routine (general part...), DE = sector to read,@HL = buffer
@01120 ;
@01130 RDBYTE	INC	L		;if 00 --> READ NEXT@SECTOR
@01140 	LD	A,(HL)
@01150 	RET	NZ
@01160 ;
@01170 	EXX
@01180 	LD	B,05H		;retry count
@01190 RDLOOP	CALL	HWREAD		;hardware dependent READ
@01200 	JR	Z,RDEXIT
@01210 	DJNZ	RDLOOP
@01220 	EXX			;time out retry count
@01230 	JP	ERROR
@01240 RDEXIT	CALL	NXTSEC		;set to read next sector
@01250 	EXX
@01260 	LD	A,(HL)
@01270 	RET
@01280 ;
@01290 ;
@01300 ;Read byte routine (hardware dependent, fill in for your@device...)
@01310 ;
@01320 NXTSEC	INC	E		;simple 1 side, 1@cylinder
@01330 	RET
@01340 ;
@01350 HWREAD	LD	A,E		;sector to read
@01360 	OUT	(SECTOR),A	;sector register of@WD1002-05
@01370 	LD	A,RDCOMD	;READ SINGLE SECTOR
@01380 	OUT	(STATUS),A	;give command
@01390 	PUSH	BC		;save BC
@01400 	PUSH	HL		;start of sector buffer
@01410 	LD	B,00H		;read 256 bytes
@01420 	LD	C,DATA		;data port of WD1002-05
@01430 HWLOOP	IN	A,(STATUS)	;status register
@01440 	BIT	7,A		;bit 7 --> busy
@01450 	JR	NZ,HWLOOP
@01460 	BIT	6,A		;bit 6 --> ready
@01470 	JR	Z,HWLOOP
@01480 	BIT	0,A		;bit 0 --> 1 === ERROR
@01490 	JR	NZ,HWFAIL
@01500 	INIR			;input 256 bytes from port@(C) TO (HL)
@01510 	XOR	A		;A=0; no error
@01520 HWFAIL	POP	HL
@01530 	POP	BC
@01540 	RET
@01550 ;
@01560 UPDATE	CALL	RADRES
@01570 	LD	HL,42FDH
@01580 	LD	(HL),03H
@01590 	INC	HL
@01600 	LD	(HL),1CH
@01610 	INC	HL
@01620 	LD	(HL),00H
@01630 	INC	HL
@01640 	RET
@01650 ;
@01660 	END	BEGIN
@
@This new boot/sys now will look for your harddisk and make and@rudementary sort of PDRIVE table (for Newdos). I guess you will@have to make it create a similar table for your favorite Dos.
@
@Next comes the code for the new ROM. To see the difference with@the existing rom-code, I placed the old code behind. Watch how@the codes match on time.
@
@
@0066 310006 LD SP, 0600
@0069 3AEC37 LD A, (37EC)
@006C 3C INC A
@006D FE02 CP 02
@006F D20000 JP NC, 0000
@0072 C3CC06 JP 06CC
@
@00B5 210501 LD HL, 0105
@
@00FC 210E01 LD HL, 010E
@
@0105 4D454D DEFM 'MEM'
@0108 205349 DEFM ' SI'
@010B 5A45 DEFM 'ZE'
@010D 00 DEFB 00
@010E 522F53 DEFM 'R/S'
@0111 204C32 DEFM ' L2'
@0114 204241 DEFM ' BA'
@0117 534943 DEFM 'SIC'
@011A 0D DEFB 0D
@011B 00 DEFB 00
@
@0471 FE40 CP 40
@0473 3808 JR C, 047D
@0475 D640 SUB 40
@0477 FE20 CP 20
@0479 3802 JR C, 047D
@047B D620 SUB 20
@047D CD4105 CALL 0541
@
@2FFB DEC3 SBC C3
@2FFD C344B2 JP B244
@
@
@0066 AF XOR A
@0067 3D DEC A
@0068 1898 JR 0000
@006A D3CF OUT (0CF), A
@006C DBCF IN A, (0CF)
@006E E6C0 AND C0
@0070 EE40 XOR 40
@0072 20F8 JR NZ, 006C
@0074 C9 RET
@
@00B5 21FB2F LD HL, 2FFB
@
@00FC 217304 LD HL, 0473
@
@0105 CD6C00 CALL 006C
@0108 21CE06 LD BC, 06CE
@010B ED79 OUT (C), A
@010D 0D DEC C
@010E 10FB DJNZ 010B
@0110 3E20 LD A, 20
@0112 CD6A00 CALL 006A
@0115 210042 LD HL, 4200
@0118 E5 PUSH HL
@0119 EDB2 INIR
@011B C9 RET
@
@0471 180A JR 047D
@0473 522F53 DEFM 'R/S'
@0476 204C32 DEFM ' L2'
@0479 2E2E DEFM '..'
@047B 0D DEFB 0D
@047C 00 DEFB 00
@047D CD4105 CALL 0541
@
@2FFB 4D656D DEFM 'Mem'
@2FFE 2E DEFM '.'
@2FFF 00 DEFB 00
@
@0674 D3FF OUT (0FF), A
@0676 21D206 LD HL, 06D2
@0679 110040 LD DE, 4000
@067C 013600 LD BC, 0036
@067F EDB0 LDIR
@0681 3D DEC A
@0682 3D DEC A
@0683 20F1 JR NZ, 0676
@0685 0627 LD B,27
@0687 12 LD (DE), A
@0688 13 INC DE
@0689 10FC DJNZ 0687
@068B 3A4038 LD A, (3840)
@068E E604 AND 04
@0690 C27500 JP NZ, 0075
@0693 317D40 LD SP, 407D
@0696 3AEC37 LD A, (37EC)
@0699 3C INC A
@069A FE02 CP 02
@069C DA7500 JP C, 0075
@069F 3E01 LD A, 01
@06A1 32E137 LD (37E1), A
@06A4 21EC37 LD HL, 37EC
@06A7 11EF37 LD DE, 37EF
@06AA 3603 LD (HL), 03
@06AC 010000 LD BC, 0000
@06AF CD6000 CALL 0060
@06B2 CB46 BIT 0, (HL)
@06B4 20FC JR NZ, 06B2
@06B6 AF XOR A
@06B7 32EE37 LD (37EE), A
@06BA 010042 LD BC, 420@
@  