copy68k.lib

来自「open source of basic interpreter of 68」· LIB 代码 · 共 27 行

LIB
27
字号
*
*  copy68k      memory copy support routine (68000)
*
*  This routine is invoked by the COPY statement.  Upon entry,
*  d0 holds the number of bytes to move, the data
*  stack TOS holds the to-address, and the NOS holds the from-
*  address.
*
*  Upon exit, all registers are preserved and the top two values
*  on the data stack have been removed.
*

_copy
	movem.l	d0/a0/a1,-(a7)	save regs
	move.l	(a4)+,a1	get dest addr to A1
	move.l	(a4)+,a0	get source addr to A0
	tst.l	d0		test for silly case
	beq	_copyx		branch if done
	subq.l	#1,d0		adjust count for loop
_copy1
	move.b	(a0)+,(a1)+	move a byte
	dbra	_copy1		count the byte
_copyx
	movem.l	(a7)+,d0/a0/a1	restore regs
	rts

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?