单片机开发资料光盘-双龙-686M.zip

源代码在线查看: 8515fourportsledshift.s

软件大小: 574027 K
上传用户: rllfllef
关键词: 686 zip 单片机 光盘
下载地址: 免注册下载 普通下载 VIP

相关代码

					.module .8515FourPortsLedShift.c
					.area text
					.dbfile E:\grc\licc\例子10.3.5\8515FourPortsLedShift.c
					.dbfunc s delay _delay fI
				;              i -> R20
				;              j -> R22
				;     delayValue -> R16
					.even
				_delay::
					rcall push_gset2
					.dbline 4{
				; #include                      
				; #define BIT(x) (1				; void delay(unsigned char delayValue)
				; {
					.dbline 6
				;  unsigned char i,j;
				;     for(i=0;i					clr R20
					rjmp L5
				L2:
					.dbline 7
				;        for (j=1;j;j++)
					ldi R22,1
					rjmp L9
				L6:
					.dbline 8
				L7:
					.dbline 7
					inc R22
				L9:
					.dbline 7
					tst R22
					brne L6
				L3:
					.dbline 6
					inc R20
				L5:
					.dbline 6
					cp R20,R16
					brlo L2
					.dbline 9}
				;            ;
				; }
				L1:
					rcall pop_gset2
					ret
					.dbsym r i 20 c
					.dbsym r j 22 c
					.dbsym r delayValue 16 c
					.dbfunc s led_pb _led_pb fI
				;              i -> R20
				;              t -> R22
					.even
				_led_pb::
					rcall push_gset2
					mov R22,R16
					.dbline 11{
				; void led_pb(unsigned char t)            
				; {
					.dbline 13
				;  unsigned char i;
				;  DDRB=0xff;                             
					ldi R24,255
					out 0x17,R24
					.dbline 14
				;  for (i=0;i					clr R20
					rjmp L14
				L11:
					.dbline 15
					.dbline 16
					ldi R16,1
					mov R17,R20
					rcall lsl8
					mov R2,R16
					com R2
					out 0x18,R2
					.dbline 17
					mov R16,R22
					rcall _delay
					.dbline 18
				L12:
					.dbline 14
					inc R20
				L14:
					.dbline 14
					cpi R20,8
					brlo L11
					.dbline 19
				;    {
				;     PORTB=~BIT(i);                      
				;     delay(t);                           
				;    }
				;  PORTB=0xff;                            
					ldi R24,255
					out 0x18,R24
					.dbline 20}
				; }
				L10:
					rcall pop_gset2
					ret
					.dbsym r i 20 c
					.dbsym r t 22 c
					.dbfunc s led_pd _led_pd fI
				;              i -> R20
				;              t -> R22
					.even
				_led_pd::
					rcall push_gset2
					mov R22,R16
					.dbline 22{
				; void led_pd(unsigned char t)            
				; {
					.dbline 24
				;  unsigned char i;
				;  DDRD=0xff;
					ldi R24,255
					out 0x11,R24
					.dbline 25
				;  for (i=0;i					clr R20
					rjmp L19
				L16:
					.dbline 26
					.dbline 27
					ldi R16,1
					mov R17,R20
					rcall lsl8
					mov R2,R16
					com R2
					out 0x12,R2
					.dbline 28
					mov R16,R22
					rcall _delay
					.dbline 29
				L17:
					.dbline 25
					inc R20
				L19:
					.dbline 25
					cpi R20,8
					brlo L16
					.dbline 30
				;     {
				;      PORTD=~BIT(i);
				;      delay(t);
				;     }
				;  PORTD=0xff;
					ldi R24,255
					out 0x12,R24
					.dbline 31}
				; }
				L15:
					rcall pop_gset2
					ret
					.dbsym r i 20 c
					.dbsym r t 22 c
					.dbfunc s led_pc _led_pc fI
				;              i -> R20
				;              t -> R22
					.even
				_led_pc::
					rcall push_gset2
					mov R22,R16
					.dbline 33{
				; void led_pc(unsigned char t)           
				; {
					.dbline 35
				;  unsigned char i;
				;  DDRC=0xff;
					ldi R24,255
					out 0x14,R24
					.dbline 36
				;  for (i=0;i					clr R20
					rjmp L24
				L21:
					.dbline 37
					.dbline 38
					ldi R16,1
					mov R17,R20
					rcall lsl8
					mov R2,R16
					com R2
					out 0x15,R2
					.dbline 39
					mov R16,R22
					rcall _delay
					.dbline 40
				L22:
					.dbline 36
					inc R20
				L24:
					.dbline 36
					cpi R20,8
					brlo L21
					.dbline 41
				;    {
				;     PORTC=~BIT(i);
				;     delay(t);
				;    }
				;  PORTC=0xff;
					ldi R24,255
					out 0x15,R24
					.dbline 42}
				; }
				L20:
					rcall pop_gset2
					ret
					.dbsym r i 20 c
					.dbsym r t 22 c
					.dbfunc s led_pa _led_pa fI
				;              i -> R20
				;              t -> R22
					.even
				_led_pa::
					rcall push_gset2
					mov R22,R16
					.dbline 44{
				; void led_pa(unsigned char t)          
				; {
					.dbline 46
				;  unsigned char i;
				;  DDRA=0xff;
					ldi R24,255
					out 0x1a,R24
					.dbline 47
				;  for (i=8;i>0;i--)                    
					ldi R20,8
					rjmp L29
				L26:
					.dbline 48
					.dbline 49
					mov R17,R20
					subi R17,1
					ldi R16,1
					rcall lsl8
					mov R2,R16
					com R2
					out 0x1b,R2
					.dbline 50
					mov R16,R22
					rcall _delay
					.dbline 51
				L27:
					.dbline 47
					dec R20
				L29:
					.dbline 47
					clr R2
					cp R2,R20
					brlo L26
					.dbline 52
				;    {
				;     PORTA=~BIT(i-1);
				;     delay(t);
				;    }
				;  PORTA=0xff;
					ldi R24,255
					out 0x1b,R24
					.dbline 53}
				; }
				L25:
					rcall pop_gset2
					ret
					.dbsym r i 20 c
					.dbsym r t 22 c
					.dbfunc s main _main fI
				;             dt -> R20
					.even
				_main::
					.dbline 55{
				; void main (void)                      
				; {
					rjmp L32
				L31:
					.dbline 58
				;  unsigned char dt;
				;  while (1)                            
				;      {
					.dbline 59
				;       for (dt=5;dt					ldi R20,5
					rjmp L37
				L34:
					.dbline 60
					.dbline 61
					mov R16,R20
					rcall _led_pb
					.dbline 62
					mov R16,R20
					rcall _led_pd
					.dbline 63
					mov R16,R20
					rcall _led_pc
					.dbline 64
					mov R16,R20
					rcall _led_pa
					.dbline 65
				L35:
					.dbline 59
					subi R20,231	; addi 25
				L37:
					.dbline 59
					cpi R20,200
					brlo L34
					.dbline 66
				L32:
					.dbline 57
					rjmp L31
				X0:
					.dbline 67}
				;          {
				;           led_pb(dt);                 
				;           led_pd(dt);
				;           led_pc(dt);
				;           led_pa(dt);
				;          }
				;       }
				; }
				L30:
					ret
					.dbsym r dt 20 c
							

相关资源