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

📄 ice159.dt

📁 义隆159仿真机检测软件
💻 DT
📖 第 1 页 / 共 2 页
字号:
;R page registers  setting
R0		==0X00;
TCC		==0X01;
R2		==0X02;
R3		==0X03;
R4		==0X04;
port5	==0x05;
port6	==0x06;
RE		==0x0e;
RF		==0X0F;

;IOC page registers setting
CONT	==0X01;
P5CR	==0X05;
P6CR	==0X06;
IOCA	==0X0A;
PDCR	==0X0B;
ODCR	==0X0C;
PHCR	==0X0D;
WDTCR	==0X0E;
IOCF	==0X0F;

high_value	==0x10;
low_value	==0x11;
high_value1	==0x12;
low_value1	==0x13;
dt1			==0x14;
dt2			==0x15;
flag		==0x16;
temp_A		==0x17;
temp_S		==0x18;

;function check display byte
port50		==0x20;
port51		==0x21;
port52		==0x22;
port53		==0x23;
port60		==0x24;
port61		==0x25;
port62		==0x26;
port63		==0x27;
port64		==0x28;
port65		==0x29;
port66		==0x2a;
port67		==0x2b;
pulldown_buf==0x2c;
pullhigh_buf==0x2d;
tcc_buf		==0x2e;
port6_buf	==0x2f;
int0_buf	==0x30;
wdt_buf		==0x31;

;I/Oport input and output display bits setting
input0		==0;
input1		==1;
output0		==2;
output1		==3;
T			==3;
P			==4;

;pull-down display bits setting
p50_down	==0;
p51_down	==1;
p52_down	==2;
p53_down	==3;
p60_down	==4;
p61_down	==5;
p62_down	==6;
p63_down	==7;

;pull-high display bits setting
p60_high	==0;
p61_high	==1;
p62_high	==2;
p63_high	==3;
p64_high	==4;
p65_high	==5;
p66_high	==6;
p67_high	==7;

;flag bits setting
key_flag  	==0;
key_state 	==1;
p60_flag  	==2;
key_over  	==3;

			org		000h
start:		nop
			nop
			jmp		main
			nop
			nop
			nop
			nop
			nop
			
			
			org		008h
			nop
			jmp		intin
			
			org		030h
main:		nop
			nop
			nop
			nop
			nop
			nop
			nop
			nop
			nop
			nop
			nop
			nop
			jbs		r3,		T
			jmp		main1
			jbs		r3,		P
			jmp		main1
clrram:		mov		a,		@0xff
			mov		r4,		a
			clr		r0				;clear ram
			dec		r4
			mov		a,		@0x3f
			and		a,		r4
			sub		a,		@0x0f
			jbs		r3,		0
			jmp		$-6				
/**************************************/ 			
main1:		mov		a,		@0xff
			iow		PDCR
			iow		PHCR
			iow		P5CR
			iow		P6CR
			mov		a,		@0x00
			mov		RF,		a
			iow		ODCR
			iow		WDTCR
			nop
			nop
/**************************************/ 			
benchmark:	mov		a,		@0x0d		;set P51 output,others input
			iow		P5CR
			mov		a,		@0xff
			iow		P6CR
			bs		port5,	1
			call	delay
			jbc		port5,	0
			inc		high_value
			bc		port5,	1
			call	delay
			jbs		port5,	0
			inc		low_value
/**************************************/ 			
benchmark1:	mov		a,		@0x0b		;set P52 output,others input
			iow		P5CR
			mov		a,		@0xff
			iow		P6CR
			bs		port5,	2
			call	delay
			jbc		port5,	0
			inc		high_value
			bc		port5,	2
			call	delay
			jbs		port5,	0
			inc		low_value	
/**************************************/ 				
benchmark2:	mov		a,		@0x07		;set P53 output,others input
			iow		P5CR
			mov		a,		@0xff
			iow		P6CR
			bs		port5,	3
			call	delay
			jbc		port5,	0
			inc		high_value
			bc		port5,	3
			call	delay
			jbs		port5,	0
			inc		low_value
/**************************************/ 			
benchmark3:	mov		a,		@0x0f		;set P60 output,others input
			iow		P5CR
			mov		a,		@0xfe
			iow		P6CR
			bs		port6,	0
			call	delay
			jbc		port5,	0
			inc		high_value
			bc		port6,	0
			call	delay
			jbs		port5,	0
			inc		low_value
/**************************************/ 			
benchmark4:	mov		a,		@0x0f		;set P61 output,others input
			iow		P5CR
			mov		a,		@0xfd
			iow		P6CR
			bs		port6,	1
			call	delay
			jbc		port5,	0
			inc		high_value
			bc		port6,	1
			call	delay
			jbs		port5,	0
			inc		low_value									
/**************************************/ 				
benchmark5:	mov		a,		@0x0f		;set P62 output,others input
			iow		P5CR
			mov		a,		@0xfb
			iow		P6CR
			bs		port6,	2
			call	delay
			jbc		port5,	0
			inc		high_value
			bc		port6,	2
			call	delay
			jbs		port5,	0
			inc		low_value														
/**************************************/ 			
benchmark6:	mov		a,		@0x0f		;set P63 output,others input
			iow		P5CR
			mov		a,		@0xf7
			iow		P6CR
			bs		port6,	3
			call	delay
			jbc		port5,	0
			inc		high_value
			bc		port6,	3
			call	delay
			jbs		port5,	0
			inc		low_value
			nop
/**************************************/ 			
benchmark7:	mov		a,		@0x0e		;set P50 output 0,others input
			iow		P5CR
			mov		a,		@0xff
			iow		P6CR
			bc		port5,	0
			call	delay
			jbs		port5,	1
			inc		low_value1		
			nop
			jbs		port5,	2
			inc		low_value1
			nop
			jbs		port5,	3
			inc		low_value1
			nop
/**************************************/ 			
			jbs		port6,	0
			inc		low_value1
			nop
			jbs		port6,	1
			inc		low_value1
			nop
			jbs		port6,	2
			inc		low_value1
			nop
			jbs		port6,	3
			inc		low_value1
			nop
/**************************************/ 			
benchmark8:	bs		port5,	0			;set P50 output 1,others input
			call	delay
			jbc		port5,	1
			inc		high_value1
			nop
			jbc		port5,	2
			inc		high_value1
			nop
			jbc		port5,	3
			inc		high_value1
			nop
/**************************************/ 			
			jbc		port6,	0
			inc		high_value1
			nop
			jbc		port6,	1
			inc		high_value1
			nop
			jbc		port6,	2
			inc		high_value1
			nop
			jbc		port6,	3
			inc		high_value1
			nop	
					
/**************************************/ 				
port50check:
			mov		a,		high_value
			sub		a,		@0x01
			jbc		r3,		0
			jmp		IO_error		
			mov		a,		low_value
			sub		a,		@0x01
			jbc		r3,		0
			jmp		IO_error
			mov		a,		high_value1
			sub		a,		@0x01
			jbc		r3,		0
			jmp		IO_error
			mov		a,		low_value1
			sub		a,		@0x01
			jbc		r3,		0
			jmp		IO_error
			mov		a,		@0x0f
			mov		port50,a
/**************************************/ 
input_check:
			mov		a,		@0x0e		;set P50 output,others input
			iow		P5CR
			mov		a,		@0xff
			iow		P6CR
input0_check:
			bc		port5,	0
			call	delay
			jbs		port5,	1
			bs		port51,	input0
			nop
			jbs		port5,	2
			bs		port52,	input0
			nop
			jbs		port5,	3
			bs		port53,	input0
			nop
/**************************************/ 			
			jbs		port6,	0
			bs		port60,	input0
			nop
			jbs		port6,	1
			bs		port61,	input0
			nop
			jbs		port6,	2
			bs		port62,	input0
			nop
			jbs		port6,	3
			bs		port63,	input0
			nop
			jbs		port6,	4
			bs		port64,	input0
			nop
			jbs		port6,	5
			bs		port65,	input0
			nop
			jbs		port6,	6
			bs		port66,	input0
			nop
			jbs		port6,	7
			bs		port67,	input0
			nop	
/**************************************/ 
input1_check:			
			bs		port5,	0
			call	delay
			jbc		port5,	1
			bs		port51,	input1
			nop
			jbc		port5,	2
			bs		port52,	input1
			nop
			jbc		port5,	3
			bs		port53,	input1
			nop
/**************************************/ 			
			jbc		port6,	0
			bs		port60,	input1
			nop
			jbc		port6,	1
			bs		port61,	input1
			nop
			jbc		port6,	2
			bs		port62,	input1
			nop
			jbc		port6,	3
			bs		port63,	input1
			nop
			jbc		port6,	4
			bs		port64,	input1
			nop
			jbc		port6,	5
			bs		port65,	input1
			nop
			jbc		port6,	6
			bs		port66,	input1
			nop
			jbc		port6,	7
			bs		port67,	input1
			nop			
/**************************************/
output_check:
			nop
			nop
port51_check:
			mov		a,		@0x0d		;set P51 output,others input
			iow		P5CR
			mov		a,		@0xff
			iow		P6CR
			bs		port5,	1
			call	delay
			jbc		port5,	0
			bs		port51,	output1
			nop
			bc		port5,	1
			call	delay	
			jbs		port5,	0
			bs		port51,	output0			
/**************************************/ 
port52_check:
			mov		a,		@0x0b		;set P52 output,others input
			iow		P5CR
			mov		a,		@0xff
			iow		P6CR
			bs		port5,	2
			call	delay
			jbc		port5,	0
			bs		port52,	output1
			nop
			bc		port5,	2
			call	delay	
			jbs		port5,	0
			bs		port52,	output0
/**************************************/ 			
port53_check:
			mov		a,		@0x07		;set P53 output,others input
			iow		P5CR
			mov		a,		@0xff
			iow		P6CR
			bs		port5,	3
			call	delay
			jbc		port5,	0
			bs		port53,	output1
			nop
			bc		port5,	3
			call	delay
			jbs		port5,	0
			bs		port53,	output0			
/**************************************/ 
port60_check:
			mov		a,		@0x0f		;set P60 output,others input
			iow		P5CR
			mov		a,		@0xfe
			iow		P6CR
			bs		port6,	0
			call	delay
			jbc		port5,	0
			bs		port60,	output1
			nop
			bc		port6,	0
			call	delay
			jbs		port5,	0
			bs		port60,	output0 	
/**************************************/ 			
port61_check:
			mov		a,		@0x0f		;set P61 output,others input
			iow		P5CR
			mov		a,		@0xfd
			iow		P6CR
			bs		port6,	1
			call	delay
			jbc		port5,	0
			bs		port61,	output1
			nop
			bc		port6,	1
			call	delay
			jbs		port5,	0
			bs		port61,	output0					
/**************************************/ 
port62_check:
			mov		a,		@0x0f		;set P62 output,others input
			iow		P5CR
			mov		a,		@0xfb
			iow		P6CR
			bs		port6,	2
			call	delay
			jbc		port5,	0
			bs		port62,	output1
			nop
			bc		port6,	2
			call	delay
			jbs		port5,	0
			bs		port62,	output0
/**************************************/ 			
port63_check:
			mov		a,		@0x0f		;set P63 output,others input
			iow		P5CR
			mov		a,		@0xf7
			iow		P6CR
			bs		port6,	3
			call	delay
			jbc		port5,	0
			bs		port63,	output1
			nop
			bc		port6,	3
			call	delay
			jbs		port5,	0
			bs		port63,	output0
/**************************************/ 			
port64_check:
			mov		a,		@0x0f		;set P64 output,others input
			iow		P5CR
			mov		a,		@0xef
			iow		P6CR
			bs		port6,	4
			call	delay
			jbc		port5,	0
			bs		port64,	output1

⌨️ 快捷键说明

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