⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rdwrhd.hs.68k

📁 用于motorala 68K系列处理器的小实时多任务操作系统 The OMU Kernel was written to provide a cut-down Unix-like O/S for a
💻 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 + -