				;file c:\users\edenlai\desktop\esk310\led marquee\LED.c
				;1	/************************************************************
				;2	* PROGRAM : LED marquee
				;3	* Wire Connection:
				;4	*   ESK303 (VDD)   connects to ESK310 (5V)
				;5	* 	ESK303 (GND)   connects to ESK310 (GND)
				;6	*   ESK303 (C0~C7) connects to ESK310 ((JP13)0~7)
				;7	* Created on 2021/08/27 by Best Modules Corp.
				;8	*************************************************************/
				;9	
				;10	#include <HT66F2390.h>
				;11	#include "setup.h"
				;12							
				;13	void main()
				;14	{	
				@code .SECTION 'CODE'
				include HT66F2390.inc
0000	1F0B	clr     PBP
0001	2802	jmp     _main_startup1
				@start .SECTION 'CODE'
				_main_startup1:
				@start .SECTION 'CODE'
0002	0F00	mov     a, 0H
0003	008B	mov     PBP, a
0004	2830	jmp     _main
0005	0000	nop
0006	0000	nop
				L0007:
0007	0000	nop
0008	0000	nop
0009	0000	nop
				L000A:
000A	0000	nop
000B	1785	sdz     ACC
000C	280A	jmp     L000A
				L000D:
000D	0000	nop
000E	1785	sdz     ACC
000F	280D	jmp     L000D
0010	5782	sdz     rc[1]
0011	280D	jmp     L000D
0012	0003	ret
				;15		setup();
				_main:
				_main:
0030	202A	call    _setup
				;16		
				;17		while(1)
				;18		{	
				;19			while(LED_Port & 0x80)					//If the MSB is not 0, the loop continues to execute
				_L10:
0031	3B9B	snz     PC7
0032	2839	jmp     _L12
				;20			{	
				;21				Delay1ms(100);
0033	0F64	mov     a, 64H
0034	4083	mov     delay, a
0035	5F04	clr     delay[1]
0036	2013	call    _Delay1ms
				;22				GCC_RL(LED_Port);					//LED_Port rotates left without carry
0037	189B	rl      PC
0038	2831	jmp     _L10
				;23			}
				;24			while(LED_Port & 0x01)					//If the LSB is not 0, the loop continues to execute	
				_L12:
0039	381B	snz     PC0
003A	2831	jmp     _L10
				;25			{	
				;26				Delay1ms(100);
003B	0F64	mov     a, 64H
003C	4083	mov     delay, a
003D	5F04	clr     delay[1]
003E	2013	call    _Delay1ms
				;27				GCC_RR(LED_Port);					//LED_Port rotates right without carry
003F	199B	rr      PC
0040	2839	jmp     _L12
0041	2841	jmp     $
				;28			}				
				;29		}
				;30	
				;31	}
				;file c:\users\edenlai\desktop\esk310\led marquee\setup.h
				;1	#define LED_Port  _pc								
				;2	#define LED_PortC _pcc
				;3	
				;4	void setup()									//Delay1ms
				;5	{	
				;6		_wdtc=0xAB;									//Turn off the watchdog timer
				_setup:
				_setup:
002A	0FAB	mov     a, ABH
002B	00BE	mov     WDTC, a
				;7		LED_PortC=0;								//Set LED_Port to output mode
002C	1F1C	clr     PCC
				;8		LED_Port=0xFE;								//Set the initial value of LED_Port
002D	0FFE	mov     a, FEH
002E	009B	mov     PC, a
002F	0003	ret
				;9	}
				;10	
				;11	void Delay1ms(unsigned short delay)				//Delay1ms
				;12	{	
				;13		unsigned short i;											
				;14		for(i=0;i<delay;i++) GCC_DELAY(2000);		//GCC_DELAY(0.5us)
				_Delay1ms:
				_Delay1ms:
0013	5F00	clr     rb
0014	5F01	clr     rc
0015	2823	jmp     _L3
				_L4:
0016	0F01	mov     a, 1H
0017	4082	mov     rc[1], a
0018	0FF0	mov     a, F0H
0019	340B	clr     PBP0
001A	348B	clr     PBP1
001B	350B	clr     PBP2
001C	2007	call    L0007
001D	350B	clr     PBP2
001E	348B	clr     PBP1
001F	340B	clr     PBP0
0020	5480	inc     rb
0021	3D0A	sz      Z
0022	5481	inc     rc
				_L3:
0023	4700	mov     a, rb
0024	4203	sub     a, delay[0]
0025	4701	mov     a, rc
0026	5204	sbc     a, delay[1]
0027	3B0A	snz     CZ
0028	2816	jmp     _L4
0029	0003	ret
				;15	}	
				;16	
				;17	void Delay10ms(unsigned short delay)			//Delay10ms
				;18	{	
				;19		unsigned short i;											
				;20		for(i=0;i<delay;i++) GCC_DELAY(20000);		//GCC_DELAY(0.5us)
				;21	}
				data .SECTION 'DATA'
				__pc DB DUP (?) ; __pc
				__pcc DB DUP (?) ; __pcc
				__wdtc DB DUP (?) ; __wdtc
				rb DB DUP (?)
				rc DB DUP (?)
				delay DB 2 DUP (?) ; delay
