+; ====================================================================
+; Function: Test disk format: simhd, simh altair 8800 hard disk format
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : temp drive #
+;
+; --------------------------------------------------------------------
+; Description: Test, if first 6 tracks are filled with 0xE5,
+; and Size = 8192 KB.
+; Actually, only the first phys. sector is tested, since
+; the other 47 sectors are not in memory at this time.
+; ====================================================================
+dsk_tst_simhd:
+
+ mov zl,temp3
+ rcall dsk_getpartentry ;get partition entry
+ ldd temp,z+PTAB_SIZE
+ ldd temp2,z+PTAB_SIZE+1 ;check, if size is 16384 phys. sectors
+ cpi temp,low(16384)
+ ldi temp,high(16384)
+ cpc temp2,temp
+ brne dsk_tsimhd_not ;wrong size
+
+ ldiw z,hostbuf
+ ldi temp2,high(512)
+ clr _tmp0 ;low(512)
+
+dsk_tsimhd_loop:
+ ld temp,z+
+ cpi temp,0xE5
+ brne dsk_tsimhd_not
+ dec _tmp0
+ brne dsk_tsimhd_loop
+ dec temp2
+ brne dsk_tsimhd_loop
+
+ clr temp
+ ret
+
+dsk_tsimhd_not:
+ ori temp,0xff ;Not a simhd hard disk image.
+ ret
+