?? rdwrhd.hs.68k
字號:
******************************************************************************* RDWRC.68k Lowest level floppy disk read and write data* This version swaps bytes around for Codata type disks******************************************************************************** Addresses of Data REQ and Busy bitsDATA: = $0FF211HS: = $0FF21BHSBIT: = 0BUSY: = $0FF219BUSYBIT:= 0HSON: = $0FF201HSONBIT: = 4* DISK read write routines* Codata C type link interface* Arguments - <Address><Byte count>********************************************************************** READ Sector Requires no bytes to be even (swaps bytes in word)********************************************************************* globl _hdmread_hdmread: movem.l a0-a4/d1-d3,-(sp) ;Saves registers used lea.l HS,a1 ;A1 points to the hand shake register lea.l BUSY,a2 ;A2 points to SCSI control register lea.l DATA,a3 ;A3 points to the data register lea.l HSON,a4 clr.l d0 ;Sets D0 for exit with no errors move.l #HSBIT,d1 ;D1 is Hand shake bit no move.l #BUSYBIT,d2 ;D2 is Busy bit no in SCSI control reg move.l 40(a7),d3 ;Gets byte count from stack (C passed) movea.l 36(a7),a0 ;Gets address freom stack (C passed) bset.b #HSONBIT,(a4) ;Turn handshake on jmp hdrstart ;Starts at end of loop for count checkhdrloop: btst.b d1,(a1) ;Checks HS bit bne hdrdata ;If set data ready btst.b d2,(a2) ;Else check busy beq hdrloop ;If zero ok no errors move.l #4,d0 jmp hdrendhdrdata: move.b (a3),(a0) ;Gets data not.b (a0)+ ;Inverts datahdrstart: dbeq d3,hdrloop ;Repeats till endhdrend: bclr.b #HSONBIT,(a4) ;Turn handshake off movem.l (sp)+,a0-a4/d1-d3 ;Recovers registers rts ;Returns********************************************************************** WRITE Sector Requires no of bytes to be even (swaps bytes in word)********************************************************************* globl _hdmwrite_hdmwrite: movem.l a0-a4/d1-d3,-(sp) ;Saves registers used lea.l HS,a1 ;A1 points to the hand shake register lea.l BUSY,a2 ;A2 points to SCSI control register lea.l DATA,a3 ;A3 points to the data register lea.l HSON,a4 clr.l d0 ;Sets D0 for exit with no errors move.l #HSBIT,d1 ;D1 is Hand shake bit no move.l #BUSYBIT,d2 ;D2 is Busy bit no in SCSI control reg move.l 40(a7),d3 ;Gets byte count from stack (C passed) movea.l 36(a7),a0 ;Gets address freom stack (C passed) bset.b #HSONBIT,(a4) ;Turn handshake on jmp hdwstart ;Starts at end of loop for count checkhdwloop: btst.b d1,(a1) ;Checks HS bit bne hdwdata ;If set data ready btst.b d2,(a2) ;Else check busy beq hdwloop ;If zero ok no errors move.l #3,d0 jmp hdwendhdwdata: move.b (a0)+,d0 ;Gets data not.b d0 ;Inverts data move.b d0,(a3) ;Sends datahdwstart: dbeq d3,hdwloop ;Repeats till endhdwend: bclr.b #HSONBIT,(a4) ;Turn handshake off movem.l (sp)+,a0-a4/d1-d3 ;Recovers registers rts ;Returns
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -