?? datalog.sdi
字號(hào):
0000011A,50F5,, movf TABLAT, W
0000011C,E1FC,, bnz UART_Puts_loop
0000011E,0012,, return
,,,
,,,;====================================================================
,,,; Read a sector from the ATA drive
,,,;--------------------------------------------------------------------
00000120,,ATA_Block_Read,ATA_Block_Read
00000120,D82A,, rcall ATA_BSY_Wait ; Drive ready for command
00000122,D83A,, rcall ATA_Send_LBA
00000124,0E20,, movlw 0x20 ; Read sectors command
00000126,6E00,, movwf TMP1
00000128,0E17,, movlw 0x17 ; ATA Command regsiter
0000012A,D857,, rcall ATA_Reg8_Write
0000012C,6A06,, clrf ATA_CNT
0000012E,EE04 F000,, lfsr FSR0, ATA_BUF
00000132,,ATA_Block_Read_Lp1,ATA_Block_Read_Lp1
00000132,D81C,, rcall ATA_DRQ_Wait ; Drive data waiting
00000134,0E10,, movlw 0x10
00000136,D85E,, rcall ATA_Reg16_Read
00000138,5000,, movf TMP1, W
0000013A,6EEE,, movwf POSTINC0
0000013C,5001,, movf TMP2, W
0000013E,6EEE,, movwf POSTINC0
00000140,3E06,, incfsz ATA_CNT
00000142,D7F7,, bra ATA_Block_Read_Lp1
00000144,0012,, return
,,,
,,,;====================================================================
,,,; Write a sector too the ATA drive
,,,;--------------------------------------------------------------------
00000146,,ATA_Block_Write,ATA_Block_Write
00000146,D817,, rcall ATA_BSY_Wait ; Drive ready for command
00000148,D827,, rcall ATA_Send_LBA
0000014A,0E30,, movlw 0x30 ; Write sectors command
0000014C,6E00,, movwf TMP1
0000014E,0E17,, movlw 0x17 ; ATA Command regsiter
00000150,D844,, rcall ATA_Reg8_Write
00000152,6A06,, clrf ATA_CNT
00000154,EE04 F000,, lfsr FSR0, ATA_BUF
,,,
00000158,,ATA_Block_Write_Lp1,ATA_Block_Write_Lp1
00000158,D809,, rcall ATA_DRQ_Wait ; Drive ready for data
0000015A,50EE,, movf POSTINC0, W
0000015C,6E00,, movwf TMP1
0000015E,50EE,, movf POSTINC0, W
00000160,6E01,, movwf TMP2
00000162,0E10,, movlw 0x10
00000164,D854,, rcall ATA_Reg16_Write
00000166,3E06,, incfsz ATA_CNT
00000168,D7F7,, bra ATA_Block_Write_Lp1
,,,
0000016A,0012,, return
,,,
,,,;====================================================================
,,,; Wait for DRQ to indicate drive is ready for data
,,,;--------------------------------------------------------------------
0000016C,,ATA_DRQ_Wait,ATA_DRQ_Wait
0000016C,0E17,, movlw 0x17 ; Drive status register
0000016E,D82A,, rcall ATA_Reg8_Read
00000170,A600,, btfss TMP1, 3 ; DRQ bit (data request)
00000172,D7FC,, bra ATA_DRQ_Wait
00000174,0012,, return
,,,
,,,;====================================================================
,,,; Wait for BSY to indicate drive is ready for a command
,,,;--------------------------------------------------------------------
00000176,,ATA_BSY_Wait,ATA_BSY_Wait
00000176,0E17,, movlw 0x17 ; Drive status register
00000178,D825,, rcall ATA_Reg8_Read
0000017A,BE00,, btfsc TMP1, 7 ; BSY bit (busy)
0000017C,D7FC,, bra ATA_BSY_Wait
0000017E,0012,, return
,,,
,,,;====================================================================
,,,; Zero out LBA address
,,,;--------------------------------------------------------------------
00000180,,ATA_A_RESET,ATA_A_RESET
00000180,6A02,, clrf ATA_A0 ; Point to first sector
00000182,6A03,, clrf ATA_A1
00000184,6A04,, clrf ATA_A2
00000186,6A05,, clrf ATA_A3
00000188,0012,, return
,,,
,,,;====================================================================
,,,; Increment LBA address by one
,,,;--------------------------------------------------------------------
0000018A,,ATA_A_INC,ATA_A_INC
0000018A,3E02,, incfsz ATA_A0 ; Point to next sector
0000018C,D004,, bra ATA_A_INC_EXIT
0000018E,3E03,, incfsz ATA_A1
00000190,D002,, bra ATA_A_INC_EXIT
00000192,4A04,, infsnz ATA_A2
00000194,2A05,, incf ATA_A3
00000196,,ATA_A_INC_EXIT,ATA_A_INC_EXIT
00000196,0012,, return
,,,
,,,;====================================================================
,,,; Transfer LBA address to drive
,,,;--------------------------------------------------------------------
00000198,,ATA_Send_LBA,ATA_Send_LBA
00000198,0E01,, movlw 0x01 ; Sector count
0000019A,6E00,, movwf TMP1
0000019C,0E12,, movlw 0x12 ; ATA Sector count
0000019E,D81D,, rcall ATA_Reg8_Write
000001A0,C002 F000,, movff ATA_A0, TMP1
000001A4,0E13,, movlw 0x13 ; ATA LBA 0-7 register
000001A6,D819,, rcall ATA_Reg8_Write
000001A8,C003 F000,, movff ATA_A1, TMP1
000001AC,0E14,, movlw 0x14 ; ATA LBA 8-15 register
000001AE,D815,, rcall ATA_Reg8_Write
000001B0,C004 F000,, movff ATA_A2, TMP1
000001B4,0E15,, movlw 0x15 ; ATA LBA 16-23 register
000001B6,D811,, rcall ATA_Reg8_Write
000001B8,5005,, movf ATA_A3, W
000001BA,0940,, iorlw B'01000000' ; Indicate address is LBA not CHS
000001BC,6E00,, movwf TMP1
000001BE,0E16,, movlw 0x16 ; ATA LBA 24-27 register
000001C0,D80C,, rcall ATA_Reg8_Write
000001C2,0012,, return
,,,;====================================================================
,,,; Read a register from the ATA drive (8 bit)
,,,;--------------------------------------------------------------------
,,,; W contains address
,,,; TMP1 contains data
,,,;--------------------------------------------------------------------
000001C4,,ATA_Reg8_Read,ATA_Reg8_Read
000001C4,AA82,, btfss PORTC, 5 ; Wait until ready
000001C6,D7FE,, bra ATA_Reg8_Read
000001C8,0B1F,, andlw B'00011111' ; Set address
000001CA,6E82,, movwf PORTC
000001CC,908D,, bcf LATE, 0 ; DIOR low
000001CE,0000,, nop ; Wait
000001D0,0000,, nop
000001D2,5081,, movf PORTB, W ; Get data
000001D4,6E00,, movwf TMP1
000001D6,808D,, bsf LATE, 0 ; DIOR high
000001D8,0012,, return
,,,
,,,; +-----------------------------------+
,,,; | PORTC 4-0 to ATA register - Read |
,,,; +------+----------------------------+
,,,; | Addr | Register |
,,,; +------+----------------------------+
,,,; | 0x0E | Alternate status |
,,,; | 0x0F | Drive address |
,,,; | 0x10 | Data (16 bit reg) |
,,,; | 0x11 | Features |
,,,; | 0x12 | Sector count |
,,,; | 0x13 | LBA 0-7 |
,,,; | 0x14 | LBA 8-15 |
,,,; | 0x15 | LBA 16-23 |
,,,; | 0x16 | LBA 24-27 |
,,,; | 0x17 | Status |
,,,; +------+----------------------------+
,,,
,,,;====================================================================
,,,; Write a register to the ATA drive (8 bit)
,,,;--------------------------------------------------------------------
,,,; W contains address
,,,; TMP1 contains data
,,,;--------------------------------------------------------------------
000001DA,,ATA_Reg8_Write,ATA_Reg8_Write
000001DA,AA82,, btfss PORTC, 5 ; Wait until ready
000001DC,D7FE,, bra ATA_Reg8_Write
000001DE,0B1F,, andlw B'00011111' ; Set address
000001E0,6E82,, movwf PORTC
000001E2,5000,, movf TMP1, W ; Set data
000001E4,6E81,, movwf PORTB
000001E6,6A93,, clrf TRISB ; Port for output
000001E8,928D,, bcf LATE, 1 ; DIOW low
000001EA,0000,, nop ; Wait
000001EC,0000,, nop
000001EE,828D,, bsf LATE, 1 ; DIOW high
000001F0,6893,, setf TRISB ; Port for input
000001F2,0012,, return
,,,
,,,; +-----------------------------------+
,,,; | PORTC 4-0 to ATA register - Write |
,,,; +------+----------------------------+
,,,; | Addr | Register |
,,,; +------+----------------------------+
,,,; | 0x0E | Device control |
,,,; | 0x10 | Data (16 bit reg) |
,,,; | 0x11 | Features |
,,,; | 0x12 | Sector count |
,,,; | 0x13 | LBA 0-7 |
,,,; | 0x14 | LBA 8-15 |
,,,; | 0x15 | LBA 16-23 |
,,,; | 0x16 | LBA 24-27 |
,,,; | 0x17 | Command |
,,,; +------+----------------------------+
,,,
,,,;====================================================================
,,,; Read a register from the ATA drive (16 bit)
,,,;--------------------------------------------------------------------
,,,; W contains address
,,,; TMP1 contains data low
,,,; TMP2 contains data high
,,,;--------------------------------------------------------------------
000001F4,,ATA_Reg16_Read,ATA_Reg16_Read
000001F4,AA82,, btfss PORTC, 5 ; Wait until ready
000001F6,D7FE,, bra ATA_Reg16_Read
000001F8,0B1F,, andlw B'00011111' ; Set address
000001FA,6E82,, movwf PORTC
000001FC,908D,, bcf LATE, 0 ; DIOR low
000001FE,0000,, nop ; Wait
00000200,0000,, nop
00000202,5081,, movf PORTB, W ; Get data
00000204,6E00,, movwf TMP1
00000206,5083,, movf PORTD, W
00000208,6E01,, movwf TMP2
0000020A,808D,, bsf LATE, 0 ; DIOR high
0000020C,0012,, return
,,,
,,,;====================================================================
,,,; Write a register to the ATA drive (16 bit)
,,,;--------------------------------------------------------------------
,,,; W contains address
,,,; TMP1 contains data low
,,,; TMP2 contains data high
,,,;--------------------------------------------------------------------
0000020E,,ATA_Reg16_Write,ATA_Reg16_Write
0000020E,AA82,, btfss PORTC, 5 ; Wait until ready
00000210,D7FE,, bra ATA_Reg16_Write
00000212,0B1F,, andlw B'00011111' ; Set address
00000214,6E82,, movwf PORTC
00000216,5000,, movf TMP1, W ; Set data
00000218,6E81,, movwf PORTB
0000021A,5001,, movf TMP2, W
0000021C,6E83,, movwf PORTD
0000021E,6A93,, clrf TRISB ; Port for output
00000220,6A95,, clrf TRISD
00000222,928D,, bcf LATE, 1 ; DIOW low
00000224,0000,, nop ; Wait
00000226,0000,, nop
00000228,828D,, bsf LATE, 1 ; DIOW high
0000022A,6893,, setf TRISB ; Ports for input
0000022C,6895,, setf TRISD
0000022E,0012,, return
,,,
,,,;====================================================================
,,,; Output string routines
,,,;--------------------------------------------------------------------
00000230,,OUT_VERSION,OUT_VERSION
00000230,0E00,, movlw UPPER(MSG_VERSION)
00000232,6EF8,, movwf TBLPTRU
00000234,0E03,, movlw HIGH(MSG_VERSION)
00000236,6EF7,, movwf TBLPTRH
00000238,0E98,, movlw LOW(MSG_VERSION)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -