; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.
;
; $Id$
-;\r
-\r
-\r
+;
+
+
; ---------------- Defines for the Filesystem Interface -------
-\r
+
;*****************************************************
;* Disk-Manager constants *
;*****************************************************
- .equ dskType_None = 0\r
- .equ dskType_CPM = 1\r
- .equ dskType_FAT = 2\r
- .equ dskType_RAM = 3\r
+ .equ dskType_None = 0
+ .equ dskType_CPM = 1
+ .equ dskType_FAT = 2
+ .equ dskType_RAM = 3
;*****************************************************
;* CP/M to host disk constants *
;*****************************************************
- .equ MAXDISKS = 4 ;Max number of Disks (partitions)\r
+ .equ MAXDISKS = 4 ;Max number of Disks (partitions)
.equ PARTENTRY_SIZE = 9 ;Size of a Partitiontableentry
.equ blksize = 1024 ;CP/M allocation size
.equ hostsize = 512 ;host disk sector size
.equ WRALL = 0 ;write to allocated
.equ WRDIR = 1 ;write to directory
.equ WRUAL = 2 ;write to unallocated
- .equ WRTMSK= 3 ;write type mask\r
+ .equ WRTMSK= 3 ;write type mask
;----------------------------------------------- Start of Data Segment
- .dseg\r
-\r
+ .dseg
+
ndisks: .byte 1 ;Number of CP/M disks
seekdsk: .byte 1 ;seek disk number
erflag: .byte 1 ;error reporting
wrtype: .byte 1 ;write operation type
-dmaadr: .byte 2 ;last dma address\r
+dmaadr: .byte 2 ;last dma address
-hostbuf: .byte hostsize ;host buffer (from/to SD-card)\r
+hostbuf: .byte hostsize ;host buffer (from/to SD-card)
hostparttbl: .byte PARTENTRY_SIZE*MAXDISKS ;host partition table (type, start sector, sector count)
hostparttbltop:
hostdsk: .byte 1 ;host disk number
-hosttype: .byte 1 ;host disk type (same entry as 1 parition entry)\r
-hostlba: .byte 3 ;host sector number (relative to partition start)\r
-\r
-\r
+hosttype: .byte 1 ;host disk type (same entry as 1 parition entry)
+hostlba: .byte 3 ;host sector number (relative to partition start)
+
+
; ------------------------------- Start of Code Segment
- .cseg\r
-\r
-; ====================================================================\r
+ .cseg
+
+; ====================================================================
; Function: Get a Pointer to a Partitiontable entry
-; ====================================================================\r
-; Parameters\r
-; --------------------------------------------------------------------\r
-; Registers : [w] z Pointer to the Partitionentry\r
-; [r] xl Number of Diskentry to Read\r
-; --------------------------------------------------------------------\r
-; Description:\r
-; ====================================================================\r
-dsk_getpartentry:\r
- \r
- ldiw z,hostparttbl\r
- mov temp,xl\r
-\r
-dsk_getpartentryloop:\r
- cp temp,_0\r
- breq dsk_getpartentryloopend\r
- adiw z,PARTENTRY_SIZE\r
- dec temp\r
- jmp dsk_getpartentryloop\r
-dsk_getpartentryloopend:\r
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : [w] z Pointer to the Partitionentry
+; [r] xl Number of Diskentry to Read
+; --------------------------------------------------------------------
+; Description:
+; ====================================================================
+dsk_getpartentry:
+
+ ldiw z,hostparttbl
+ mov temp,xl
+
+dsk_getpartentryloop:
+ cp temp,_0
+ breq dsk_getpartentryloopend
+ adiw z,PARTENTRY_SIZE
+ dec temp
+ rjmp dsk_getpartentryloop
+dsk_getpartentryloopend:
ret
-\r
-; ====================================================================\r
+
+; ====================================================================
; Function:
-; ====================================================================\r
-; Parameters\r
-; --------------------------------------------------------------------\r
-; Registers : none\r
-; Variables : [r] seeksec Sector to read\r
-; [r] seektrk Track to read\r
-; --------------------------------------------------------------------\r
-; Description:\r
-; ====================================================================\r
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : none
+; Variables : [r] seeksec Sector to read
+; [r] seektrk Track to read
+; --------------------------------------------------------------------
+; Description:
+; ====================================================================
dskDiskCheck:
lds temp2,seekdsk
cpi temp2,RAMDISKNR
dskDmah:
sts dmaadr+1,temp
- ret\r
+ ret
-; ====================================================================\r
+; ====================================================================
; Function: Does a Disk interaction
-; ====================================================================\r
-; Parameters\r
-; --------------------------------------------------------------------\r
-; Registers : none\r
-; Variables : [r] seeksec Sector to read\r
-; [r] seektrk Track to read\r
-; --------------------------------------------------------------------\r
-; Description:\r
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : none
+; Variables : [r] seeksec Sector to read
+; [r] seektrk Track to read
+; --------------------------------------------------------------------
+; Description:
; ====================================================================
dskDoIt:
.if DISK_DEBUG
sbis flags,hostwrt ;check for pending write
cbi flags,hostact ;clear host active flag
ret
-\r
-\r
-; ====================================================================\r
+
+
+; ====================================================================
; Function: Does a Disk read operation
-; ====================================================================\r
-; Parameters\r
-; --------------------------------------------------------------------\r
-; Registers : none\r
-; Variables : [r] seekdsk Number of Disk to Read\r
-; [r] seeksec Sector to read\r
-; [r] seektrk Track to read\r
-; --------------------------------------------------------------------\r
-; Description:\r
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : none
+; Variables : [r] seekdsk Number of Disk to Read
+; [r] seeksec Sector to read
+; [r] seektrk Track to read
+; --------------------------------------------------------------------
+; Description:
; ====================================================================
dsk_read:
sts erflag,_0
- sbi flags,readop ; Set read operation flag\r
+ sbi flags,readop ; Set read operation flag
lds xl,seekdsk
- rcall dsk_getpartentry ; Get Paritiontableentry\r
- ld temp,z ; Get Partitiontype\r
-\r
-; Isn't it a Disk ?\r
- cpi temp,dskType_None\r
- brne PC+2\r
- rjmp dsk_read_err\r
+ rcall dsk_getpartentry ; Get Paritiontableentry
+ ld temp,z ; Get Partitiontype
+
+; Isn't it a Disk ?
+ cpi temp,dskType_None
+ brne PC+2
+ rjmp dsk_read_err
; Is it a RamDisk ?
- cpi temp,dskType_RAM\r
- brne PC+2\r
- rjmp rdsk_read\r
-; It must be a FAT16-Imagefile or CP/M Partition.\r
+ cpi temp,dskType_RAM
+ brne PC+2
+ rjmp rdsk_read
+; It must be a FAT16-Imagefile or CP/M Partition.
sts unacnt,_0
sbi flags,rsflag ;must read data
ldi temp,WRUAL ;write type
sts wrtype,temp ;treat as unalloc
- rjmp dsk_rwoper ;to perform the read\r
+ rjmp dsk_rwoper ;to perform the read
-dsk_read_err:\r
- ret\r
+dsk_read_err:
+ ret
-; ====================================================================\r
+; ====================================================================
; Function: Does a Disk write operation
-; ====================================================================\r
-; Parameters\r
-; --------------------------------------------------------------------\r
-; Registers : none\r
-; Variables : [r] seekdsk Number of Disk to Read\r
-; [r] seeksec Sector to read\r
-; [r] seektrk Track to read\r
-; --------------------------------------------------------------------\r
-; Description:\r
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : none
+; Variables : [r] seekdsk Number of Disk to Read
+; [r] seeksec Sector to read
+; [r] seektrk Track to read
+; --------------------------------------------------------------------
+; Description:
; ====================================================================
dsk_write:
;write the selected sector
sts erflag,_0
- cbi flags,readop ; not a read operation\r
+ cbi flags,readop ; not a read operation
lds xl,seekdsk
- rcall dsk_getpartentry ; Get Paritiontableentry\r
- ld temp,z ; Get Partitiontype\r
-\r
-; Isn't it a Disk ?\r
- cpi temp,dskType_None\r
- brne PC+2\r
- rjmp dsk_write_err\r
-\r
+ rcall dsk_getpartentry ; Get Paritiontableentry
+ ld temp,z ; Get Partitiontype
+
+; Isn't it a Disk ?
+ cpi temp,dskType_None
+ brne PC+2
+ rjmp dsk_write_err
+
; Is it a RamDisk ?
- cpi temp,dskType_RAM\r
- brne PC+2\r
- rjmp rdsk_write\r
-\r
-; It must be a FAT16-Imagefile or CP/M Partition.\r
+ cpi temp,dskType_RAM
+ brne PC+2
+ rjmp rdsk_write
+
+; It must be a FAT16-Imagefile or CP/M Partition.
cbi flags,readop ;not a read operation
;not an unallocated record, requires pre-read
sts unacnt,_0 ;unacnt = 0
sbi flags,rsflag ;rsflag = 1
- rjmp dsk_rwoper\r
-\r
-dsk_write_err:\r
- ret\r
-\r
-; ====================================================================\r
+ rjmp dsk_rwoper
+
+dsk_write_err:
+ ret
+
+; ====================================================================
; Function: Does a Disk read/write operation
-; ====================================================================\r
-; Parameters\r
-; --------------------------------------------------------------------\r
-; Registers : none\r
-; Variables : [r] seekdsk Number of Disk to Read\r
-; [r] seeksec Sector to read\r
-; [r] seektrk Track to read\r
-; --------------------------------------------------------------------\r
-; Description:\r
-; ====================================================================\r
-dsk_rwoper:\r
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : none
+; Variables : [r] seekdsk Number of Disk to Read
+; [r] seeksec Sector to read
+; [r] seektrk Track to read
+; --------------------------------------------------------------------
+; Description:
+; ====================================================================
+dsk_rwoper:
;enter here to perform the read/write
.if DISK_DEBUG
printstring ", flags: "
pop temp2 ;get buffer number (which part of hostbuf)
mul temp2,temp
add zl,r0 ;offset in hostbuf
- adc zh,r1\r
+ adc zh,r1
.if DISK_DEBUG > 2
push r0
dsk_wdir1:
rcall dsk_writehost ;clear host buff
cbi flags,hostwrt ;buffer written
- ret\r
-\r
-; ====================================================================\r
+ ret
+
+; ====================================================================
; Function: Does a Disk write operation
-; ====================================================================\r
-; Parameters\r
-; --------------------------------------------------------------------\r
-; Registers : none\r
-; Variables : [r] seekdsk Number of Disk to Read\r
-; [r] seeksec Sector to read\r
-; [r] seektrk Track to read\r
-; --------------------------------------------------------------------\r
-; Description:\r
-; ====================================================================\r
-dsk_writehost:\r
- lds xl,hostdsk\r
- rcall dsk_getpartentry\r
- ld temp,z\r
-\r
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : none
+; Variables : [r] seekdsk Number of Disk to Read
+; [r] seeksec Sector to read
+; [r] seektrk Track to read
+; --------------------------------------------------------------------
+; Description:
+; ====================================================================
+dsk_writehost:
+ lds xl,hostdsk
+ rcall dsk_getpartentry
+ ld temp,z
+
+#if FAT16_SUPPORT
; Is it a FAT16 Diskimage ?
- cpi temp,dskType_FAT\r
- brne PC+2\r
- rjmp fat_writehost\r
-\r
+ cpi temp,dskType_FAT
+ brne PC+2
+ rjmp fat_writehost
+#endif
+
; Is it a CP/M Partition ?
- cpi temp,dskType_CPM\r
- brne PC+2\r
- rjmp cpm_writehost\r
-; Disktype not supported -> Return \r
- ret\r
-\r
-; ====================================================================\r
+ cpi temp,dskType_CPM
+ brne PC+2
+ rjmp cpm_writehost
+; Disktype not supported -> Return
+ ret
+
+; ====================================================================
; Function: Does a Disk read operation
-; ====================================================================\r
-; Parameters\r
-; --------------------------------------------------------------------\r
-; Registers : none\r
-; Variables : [r] seekdsk Number of Disk to Read\r
-; [r] seeksec Sector to read\r
-; [r] seektrk Track to read\r
-; --------------------------------------------------------------------\r
-; Description:\r
-; ====================================================================\r
-dsk_readhost:\r
- lds xl,hostdsk\r
- rcall dsk_getpartentry\r
- ld temp,z\r
-\r
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : none
+; Variables : [r] seekdsk Number of Disk to Read
+; [r] seeksec Sector to read
+; [r] seektrk Track to read
+; --------------------------------------------------------------------
+; Description:
+; ====================================================================
+dsk_readhost:
+ lds xl,hostdsk
+ rcall dsk_getpartentry
+ ld temp,z
+
+#if FAT16_SUPPORT
; Is it a FAT16 Diskimage ?
- cpi temp,dskType_FAT\r
- brne PC+2\r
- rjmp fat_readhost\r
-\r
+ cpi temp,dskType_FAT
+ brne PC+2
+ rjmp fat_readhost
+#endif
+
; Is it a CP/M Partition ?
- cpi temp,dskType_CPM\r
- brne PC+2\r
- rjmp cpm_readhost\r
-; Disktype not supported -> Return \r
- ret\r
-\r
+ cpi temp,dskType_CPM
+ brne PC+2
+ rjmp cpm_readhost
+; Disktype not supported -> Return
+ ret
+
; Various Management functions for the Interaction with the File-\r
-; systems
-;
-; Copyright (C) 2010 Frank Zoll
-;
-; This file is part of avrcpm.
-;
-; avrcpm is free software: you can redistribute it and/or modify it
-; under the terms of the GNU General Public License as published by
-; the Free Software Foundation, either version 3 of the License, or
-; (at your option) any later version.
-;
-; avrcpm is distributed in the hope that it will be useful,
-; but WITHOUT ANY WARRANTY; without even the implied warranty of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-; GNU General Public License for more details.
-;
-; You should have received a copy of the GNU General Public License
-; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.
-;
-; $Id$
+; systems\r
;\r
+; Copyright (C) 2010 Frank Zoll\r
+;\r
+; This file is part of avrcpm.\r
+;\r
+; avrcpm is free software: you can redistribute it and/or modify it\r
+; under the terms of the GNU General Public License as published by\r
+; the Free Software Foundation, either version 3 of the License, or\r
+; (at your option) any later version.\r
+;\r
+; avrcpm is distributed in the hope that it will be useful,\r
+; but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+; GNU General Public License for more details.\r
+;\r
+; You should have received a copy of the GNU General Public License\r
+; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.\r
+;\r
+; $Id$\r
+;\r
+\r
\r
+; ------------------------- Defines for the disk management Structures\r
\r
-; ------------------------- Defines for the disk management Structures
+;----------------------------------------------- Start of Data Segment\r
\r
-;----------------------------------------------- Start of Data Segment
-
.dseg\r
\r
\r
\r
-; ------------------------------- Start of Code Segment
+; ------------------------------- Start of Code Segment\r
.cseg\r
\r
; ====================================================================\r
-; Function: Scans a Disk for CP/M Partions
+; Function: Scans a Disk for CP/M Partions\r
; ====================================================================\r
; Parameters\r
; --------------------------------------------------------------------\r
; on the Disk will be used for a detailed analyses. If there\r
; are any Files like "cpm_x.img" are found, these Files will be\r
; used as Disks by the CP/M- System. ( x must be in the Range A to D )\r
-; ====================================================================
+; ==================================================================== \r
mgr_init_partitions:\r
\r
sts ndisks,_0 ; Set Number of Disks to 0\r
\r
; Initialize temp partition table\r
- ldiw y,tmp_tbl
- ldi temp2,PARTENTRY_SIZE*MAXDISKS
-mgr_picl:
- st y+,_0
- dec temp2
+ ldiw y,tmp_tbl\r
+ ldi temp2,PARTENTRY_SIZE*MAXDISKS\r
+mgr_picl:\r
+ st y+,_0\r
+ dec temp2\r
brne mgr_picl\r
\r
-; Start mmc Card interaction
- call mmcInit
- andi temp,MMCST_NOINIT & MMCST_NODISK
- brne mgr_pierr
-
-;Load first sector from MMC (boot sector)
- ldiw y,0 ; Sector 0
- movw x,y
- call mmcReadSect
- tst temp
- breq mgr_check_bootsektor
-
-mgr_pierr:
- clr temp
+; Start mmc Card interaction\r
+ rcall mmcInit\r
+ andi temp,MMCST_NOINIT & MMCST_NODISK\r
+ brne mgr_pierr\r
+ \r
+;Load first sector from MMC (boot sector)\r
+ ldiw y,0 ; Sector 0\r
+ movw x,y\r
+ lcall mmcReadSect\r
+ tst temp\r
+ breq mgr_check_bootsektor\r
+\r
+mgr_pierr:\r
+ clr temp\r
ret\r
\r
mgr_check_bootsektor:\r
;Pointer to first temp table entry\r
- ldiw y,tmp_tbl
-;Test, if it has a valid MBR
-
- ldiw z,hostbuf+510-1 ;Point to last byte of partition table
-
- ldi temp3,0 ;temp3 holds number of found disks (paritions)
- ldd temp,z+1 ;MBR signature (0xAA55) at and of sector?
- ldd temp2,z+2
- ldi temp4,0xAA
- cpi temp,0x55
- cpc temp2,temp4
- breq mgr_search
-
-;No MBR, no partition table ...
- inc temp3 ;pretend we have one.
+ ldiw y,tmp_tbl\r
+;Test, if it has a valid MBR\r
+\r
+ ldiw z,hostbuf+510-1 ;Point to last byte of partition table\r
+\r
+ ldi temp3,0 ;temp3 holds number of found disks (paritions)\r
+ ldd temp,z+1 ;MBR signature (0xAA55) at and of sector?\r
+ ldd temp2,z+2\r
+ ldi temp4,0xAA\r
+ cpi temp,0x55 \r
+ cpc temp2,temp4\r
+ breq mgr_search\r
+\r
+;No MBR, no partition table ...\r
+ inc temp3 ;pretend we have one.\r
ldi temp,high((1<<16) * 128/512)\r
ldi temp2,dskType_CPM\r
- std y+0,temp2
- std y+1,_0 ;start at beginning of card
- std y+2,_0
- std y+3,_0
- std y+4,_0
- std y+5,_0 ;max CP/M 2.2 disk size
- std y+6,temp ;
- std y+7,_0
- std y+8,_0
+ std y+0,temp2\r
+ std y+1,_0 ;start at beginning of card\r
+ std y+2,_0\r
+ std y+3,_0\r
+ std y+4,_0\r
+ std y+5,_0 ;max CP/M 2.2 disk size\r
+ std y+6,temp ;\r
+ std y+7,_0\r
+ std y+8,_0\r
rjmp mgr_pend\r
\r
; Search for valid Partitions and ImageFiles \r
mgr_search:\r
- sbiw z,63 ;Now at first byte of partition table
- ldi temp4,high(hostbuf+510)
+ sbiw z,63 ;Now at first byte of partition table\r
+ ldi temp4,high(hostbuf+510)\r
\r
-mgr_ploop:
+mgr_ploop:\r
\r
; Get Partitiontype\r
- ldd temp,z+PART_TYPE
+ ldd temp,z+PART_TYPE\r
\r
; Test for CP/M Partition\r
- cpi temp,PARTID_CPM
- brne mgr_nextp
-
- rcall cpm_add_partition
+ cpi temp,PARTID_CPM\r
+ brne mgr_nextp\r
+ \r
+ rcall cpm_add_partition\r
\r
- inc temp3
- cpi temp3,MAXDISKS
+ inc temp3\r
+ cpi temp3,MAXDISKS\r
breq mgr_pend\r
- rjmp mgr_nextp\r
-
-mgr_nextp:
- adiw zl,16
- cpi zl,low(hostbuf+510)
- cpc zh,temp4
+ \r
+mgr_nextp:\r
+ adiw zl,16\r
+ cpi zl,low(hostbuf+510)\r
+ cpc zh,temp4\r
brlo mgr_ploop\r
\r
+#if FAT16_SUPPORT\r
+\r
; Test for FAT16 Partition\r
- ldiw z,hostbuf+510-1-63 ;Point to first byte of partition table
- ldi temp4,high(hostbuf+510)
+ ldiw z,hostbuf+510-1-63 ;Point to first byte of partition table\r
+ ldi temp4,high(hostbuf+510)\r
\r
-mgr_ploop2:
+mgr_ploop2:\r
\r
; Get Partitiontype\r
- ldd temp,z+PART_TYPE
+ ldd temp,z+PART_TYPE\r
\r
; Test for FAT Partition\r
- cpi temp,PARTID_FAT16
- brne mgr_nextp2
-
- rcall fat_add_partition
-
+ cpi temp,PARTID_FAT16\r
+ brne mgr_nextp2\r
+ \r
+ rcall fat_add_partition\r
+\r
rjmp mgr_pend\r
-
-mgr_nextp2:
- adiw zl,16
- cpi zl,low(hostbuf+510)
- cpc zh,temp4
+ \r
+mgr_nextp2:\r
+ adiw zl,16\r
+ cpi zl,low(hostbuf+510)\r
+ cpc zh,temp4\r
brlo mgr_ploop2\r
+#endif\r
\r
mgr_pend:\r
\r
; Initialize RAM-Disks\r
rcall rdsk_add_partition\r
\r
-;Store new partitions and check if the SD card has been changed.
-
- ldiw y,tmp_tbl
- ldiw z,hostparttbl
- ldi temp4,PARTENTRY_SIZE*MAXDISKS
+;Store new partitions and check if the SD card has been changed.\r
+\r
+ ldiw y,tmp_tbl\r
+ ldiw z,hostparttbl\r
+ ldi temp4,PARTENTRY_SIZE*MAXDISKS\r
clt\r
-
-mgr_pcpl:
- ld temp,y+
- ld temp2,z
- st z+,temp
- cpse temp,temp2
- set
- dec temp4
- brne mgr_pcpl
-
- mov temp,temp3
- sts ndisks,temp
- brtc mgr_pcpe
-
- tst temp
- breq mgr_pcpe
-
-; SD card not changed.
- rcall fat_scan_partition\r
\r
+mgr_pcpl:\r
+ ld temp,y+\r
+ ld temp2,z\r
+ st z+,temp\r
+ cpse temp,temp2\r
+ set\r
+ dec temp4\r
+ brne mgr_pcpl\r
+\r
+ mov temp,temp3\r
+ sts ndisks,temp\r
+ brtc mgr_pcpe\r
+\r
+ tst temp\r
+ breq mgr_pcpe\r
+\r
+; SD card not changed.\r
+\r
+#if FAT16_SUPPORT\r
+ rcall fat_scan_partition\r
+#endif\r
lds temp,ndisks\r
- sbr temp,0x80
-
+ sbr temp,0x80\r
+\r
mgr_pcpe:\r
-
+\r
ret\r
\r
\r
; ====================================================================\r
-; Function: Print partition table info
+; Function: Print partition table info\r
; ====================================================================\r
; Parameters\r
; --------------------------------------------------------------------\r
; --------------------------------------------------------------------\r
; Description:\r
; ====================================================================\r
-
-mgr_prnt_parttbl:
- ldiw z,hostparttbl
-pprl:
- ldd temp ,z+1 ;Get partition start
- ldd temp2,z+2
- ldd temp3,z+3
- ldd temp4,z+4
- printnewline
- cp temp,_0 ;If zero ...
- cpc temp2,_0
- cpc temp3,_0
- cpc temp4,_0
- breq mgr_prnop ;... no partition table at 0
\r
+mgr_prnt_parttbl:\r
+ ldiw z,hostparttbl\r
+pprl:\r
; Partitiontype examining\r
+\r
ldd xl,z+0\r
+; Empty slot?\r
+ cpi xl,dskType_None\r
+ breq mgr_goto_next_part\r
+\r
+ printnewline\r
+\r
; CP/M ?\r
cpi xl,dskType_CPM\r
brne mgr_prtb_nocpm\r
- rcall mgr_prnt_table_cpm
+ rcall mgr_prnt_table_cpm\r
rjmp mgr_prnt_size\r
\r
; FAT16 ?\r
-mgr_prtb_nocpm:
+mgr_prtb_nocpm:\r
cpi xl,dskType_FAT\r
brne mgr_prtb_nofat\r
- rcall mgr_prnt_table_fat
- rjmp mgr_prnt_size
+ rcall mgr_prnt_table_fat\r
+ rjmp mgr_prnt_size\r
; RAMDISK ?\r
mgr_prtb_nofat:\r
cpi xl,dskType_RAM\r
brne mgr_prnt_err\r
- rcall mgr_prnt_table_ram
+ rcall mgr_prnt_table_ram\r
rjmp mgr_prnt_size\r
; Entry Error\r
mgr_prnt_err: \r
- rcall mgr_prnt_table_err
+ rcall mgr_prnt_table_err\r
rjmp mgr_prnt_size\r
\r
-mgr_prnop:
- rcall mgr_prnt_image
+mgr_prnop:\r
+ rcall mgr_prnt_image\r
\r
mgr_prnt_size:\r
- rcall print_ultoa
- printstring ", size: "
-\r
- ldd temp ,z+5 ;Get partition size
- ldd temp2,z+6 ;Get partition size
- ldd temp3,z+7 ;Get partition size
- ldd temp4,z+8 ;Get partition size
-
- lsr temp4
- ror temp3
- ror temp2
- ror temp
- rcall print_ultoa
+ ldd temp ,z+1 ;Get partition start\r
+ ldd temp2,z+2\r
+ ldd temp3,z+3\r
+ ldd temp4,z+4\r
+ lcall print_ultoa\r
+ printstring ", size: "\r
+\r
+ ldd temp ,z+5 ;Get partition size\r
+ ldd temp2,z+6 ;Get partition size\r
+ ldd temp3,z+7 ;Get partition size\r
+ ldd temp4,z+8 ;Get partition size\r
+\r
+ lsr temp4\r
+ ror temp3\r
+ ror temp2\r
+ ror temp\r
+ lcall print_ultoa\r
printstring "KB."\r
-
-mgr_goto_next_part:
- adiw z,PARTENTRY_SIZE
- ldi temp,high(hostparttbltop)
- cpi zl, low (hostparttbltop)
- cpc zh,temp
- brlo pprl
-\r
-mgr_pppre:
- ret
+\r
+mgr_goto_next_part: \r
+ adiw z,PARTENTRY_SIZE\r
+ ldi temp,high(hostparttbltop)\r
+ cpi zl, low (hostparttbltop)\r
+ cpc zh,temp\r
+ brlo pprl\r
+\r
+mgr_pppre:\r
+ ret\r
\r
\r
-mgr_prnt_fatsize:
- rcall print_ultoa
- printstring ", size: "
+mgr_prnt_fatsize:\r
+ lcall print_ultoa\r
+ printstring ", size: "\r
\r
- ldd temp ,z+5 ;Get partition size
- ldd temp2,z+6 ;Get partition size
- ldd temp3,z+7 ;Get partition size
- ldd temp4,z+8 ;Get partition size
-
- rcall print_ultoa
- printstring "BYTE."
-
- jmp mgr_goto_next_part\r
-
-mgr_prnt_table_cpm:
- printstring "CP/M partition at: "
+ ldd temp ,z+5 ;Get partition size\r
+ ldd temp2,z+6 ;Get partition size\r
+ ldd temp3,z+7 ;Get partition size\r
+ ldd temp4,z+8 ;Get partition size\r
+\r
+ lcall print_ultoa\r
+ printstring "BYTE."\r
+ \r
+ rjmp mgr_goto_next_part\r
+\r
+mgr_prnt_table_cpm:\r
+ printstring "CP/M partition at: "\r
ret\r
\r
-mgr_prnt_table_fat:
- printstring "FAT16 File-Image at: "
+mgr_prnt_table_fat:\r
+ printstring "FAT16 File-Image at: "\r
ret\r
\r
-mgr_prnt_table_ram:
- printstring "Ramdisk at: "
+mgr_prnt_table_ram:\r
+ printstring "Ramdisk at: "\r
ret\r
\r
-mgr_prnt_table_err:
- printstring "Unknown Entry at: "
+mgr_prnt_table_err:\r
+ printstring "Unknown Entry at: "\r
ret\r
-
-mgr_prnt_image:
- printstring "Assuming CP/M image at: "
+\r
+mgr_prnt_image:\r
+ printstring "Assuming CP/M image at: "\r
ret\r
-
+\r
\r