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

📄 init751.a51

📁 上课老师给的8086仿真器
💻 A51
字号:
;------------------------------------------------------------------------------
;  This file is part of the C-51 Compiler package
;  Copyright (c) KEIL ELEKTRONIK and Franklin Software GmbH 1989-1993
;------------------------------------------------------------------------------
;  INIT751.A51:  This code is executed, if the application program contains
;                initialized variables at file level.
;
;  To assemble this file use A51 with the following invocation:
;     A51 INIT751.A51
;
;  To link the modified INIT.OBJ file to your application use the following
;  L51 invocation:
;     L51 <your object file list>, INIT751.OBJ <controls>
;
;------------------------------------------------------------------------------
;
;  User-defined Watch-Dog Refresh.
;
;  If the C application contains many variables to be initialized AND uses 
;  a watchdog timer, it may be necessary to refresh the timer during the 
;  initialization process.  The following watchdog refresh routine may be 
;  modified as needed and can be included where appropriate with a MACRO 
;  invocation.  You can alter all CPU registers except DPTR.
;
WATCHDOG	MACRO
				; Pet the Watchdog here
		ENDM
;------------------------------------------------------------------------------

		NAME	?C_INIT


?C_C51STARTUP	SEGMENT   CODE
?C_INITSEG	SEGMENT   CODE		; Segment with Initializing Data


EXTRN CODE (?C_INITSEGSTART)

		EXTRN CODE (MAIN)
		PUBLIC	?C_START

		RSEG	?C_C51STARTUP
INITEND:	AJMP	MAIN

IorPData:				; If CY=1 PData Values
		CLR	A
		MOVC	A,@A+DPTR
		INC	DPTR
		MOV	R0,A		; Start Address
IorPLoop:	CLR	A
		MOVC	A,@A+DPTR
		INC	DPTR
		MOV	@R0,A
Common:		INC	R0
		DJNZ	R7,IorPLoop
		SJMP	Loop

Bits:		CLR	A
		MOVC	A,@A+DPTR
		INC	DPTR
		MOV	R0,A
		ANL	A,#007H
		ADD	A,#Table-LoadTab
		XCH	A,R0
		CLR	C	
		RLC	A		; Bit Condition to Carry
		SWAP	A
		ANL	A,#00FH
		ORL	A,#20H		; Bit Address
		XCH	A,R0		; convert to Byte Addressen
		MOVC	A,@A+PC
LoadTab:	JC	Setzen
		CPL	A
		ANL	A,@R0
		SJMP	BitReady
Setzen:		ORL	A,@R0
BitReady:	MOV	@R0,A
		DJNZ	R7,Bits
		SJMP	Loop

Table:		DB	00000001B
		DB	00000010B
		DB	00000100B
		DB	00001000B
		DB	00010000B
		DB	00100000B
		DB	01000000B
		DB	10000000B
		

?C_START:	
		MOV	DPTR,#?C_INITSEGSTART
LOOP:		CLR	A
		MOV	R6,#1
		MOVC	A,@A+DPTR
		JZ	INITEND
		INC	DPTR
		MOV	R7,A
		ANL	A,#3FH
		JNB	ACC.5,NOBIG
		ANL	A,#01FH
		MOV	R6,A
		CLR	A
		MOVC	A,@A+DPTR
		INC	DPTR
		JZ	NOBIG
		INC	R6
NOBIG:		XCH	A,R7
		ANL	A,#0C0H		; Typ is in Bit 6 and Bit 7
		ADD	A,ACC
		JZ	IorPDATA
		JC	Bits
		SJMP	$

		RSEG	?C_INITSEG
		DB	0

		END

⌨️ 快捷键说明

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