crt0.s

来自「这是TFTP 协议的最新源代码 很辛苦的」· S 代码 · 共 91 行

S
91
字号
/*	Copyright 2001-2004 Georges Menie (www.menie.org)    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU Lesser General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program 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 Lesser General Public License for more details.    You should have received a copy of the GNU Lesser General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/	.title "crt0.S for m68k"	.extern main	.extern __stack	.extern __text_end	.extern __data_start	.extern __data_end	.extern __bss_start	.extern __bss_end	.global startstart:	/* initialize the stack */	move.l  #__stack, %sp	/* initialize the data section */	lea.l	__text_end,%a0	lea.l	__data_start,%a1	lea.l	__data_end,%a21:	cmpa.l  %a1,%a2	jbeq	2f	move.l	(%a0)+,(%a1)+	jbra	1b2:	/* initialize the bss section */	lea.l   __bss_start,%a0	lea.l   __bss_end,%a11:	cmpa.l  %a0,%a1	jbeq	2f	move.l  #0,(%a0)+	jbra	1b2:	/* * call the main routine from the application to get it going. * main (argc, argv, environ) * we pass argv as a pointer to NULL. */	pea     0	pea     environ	pea     %sp@(4)	pea     0	jsr	main/* * Define exit to a jump to the board monitor */	.global exitexit:	move.l	#-1,0xfffff304	move.b	#0,0xfffff300;	movea.l	#0x04000000,%a0;	movea.l	0(%a0),%sp;	movea.l	4(%a0),%a0;	jmp	(%a0);/* * Define an empty __main */	.global __main__main:	rts/* * Define an empty environment. */	.data	.align 2environ:	.long 0

⌨️ 快捷键说明

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