CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

if I compile ASM code I got several times the same opcode, i

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Axl
Guest







if I compile ASM code I got several times the same opcode, i
PostPosted: Tue Nov 20, 2001 11:16 am     Reply with quote

Hi to all!
I'm writing some code using CCS PCM C Compiler, Version 2.734 and I've seen something that I don't like too much.

Is it normal that if I write

#asm
nop
#endasm

I got opcodes for 12 (I suppose, I don't remember) 'nop' instructions in the absolute listing file (and also in program memory)?
I've to optimize my code, but if I rewrite my subs in asm I get an huge wasting code... (Yeah! What a kind of optimization!! ;D )

Thanks to all!
Axl
___________________________
This message was ported from CCS's old forum
Original Post ID: 1253
Felix Althaus



Joined: 09 Sep 2003
Posts: 67
Location: Winterthur, Switzerland

View user's profile Send private message

Re: if I compile ASM code I got several times the same opcod
PostPosted: Tue Nov 20, 2001 12:17 pm     Reply with quote

Hello

Can you post your C code and your list file, please?

mfg
Felix
___________________________
This message was ported from CCS's old forum
Original Post ID: 1255
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: if I compile ASM code I got several times the same opcod
PostPosted: Tue Nov 20, 2001 5:03 pm     Reply with quote

:=Hi to all!
:=I'm writing some code using CCS PCM C Compiler, Version 2.734 and I've seen something that I don't like too much.
:=
:=Is it normal that if I write
:=
:=#asm
:= nop
:=#endasm

I tested this with vs. 2.734, in a very simple test program,
and it worked OK. There was only one NOP instruction generated
by the compiler.
___________________________
This message was ported from CCS's old forum
Original Post ID: 1260
Axl
Guest







Re: if I compile ASM code I got several times the same opcod
PostPosted: Wed Nov 21, 2001 12:42 am     Reply with quote

:=:=Is it normal that if I write
:=:=
:=:=#asm
:=:= nop
:=:=#endasm
:=
:=I tested this with vs. 2.734, in a very simple test program,
:=and it worked OK. There was only one NOP instruction generated
:=by the compiler.

It was only an example because I wasn't at work. Today I'll post my code.

Thanks,
Axl
___________________________
This message was ported from CCS's old forum
Original Post ID: 1270
Axl
Guest







Re: if I compile ASM code I got several times the same opcod
PostPosted: Wed Nov 21, 2001 3:04 am     Reply with quote

:=Hello
:=
:=Can you post your C code and your list file, please?
:=
:=mfg
:=Felix

I do what I can... :)

Those that follow are segments of my code that is assembled in that strange mode. I can't post whole code for two reason, first, I don't have permission from others members of my team, and second, it's a 540kb .lst file...

Maybe, if you'll need it, I could rewrite a small program including this code (and so I can post sources with no royalties problems).

I post just this two pieces of my code (that are big enough to understand what I mean for 'code expansion' and I hope are enough clear to help you to help me. Smile )

The program that include this two subs is compiled with no #opt directive (but I've tried with #opt 5 (and 1, 2, 3, 4...) and it doesn't change anything.)

clock for delay subs is set as '#use delay (clock=4000000)'

An example:

0000 02632 .................... #INLINE
0000 02633 .................... void L_Busy_S(void) {
0000 02634 ....................
0000 02635 .................... unsigned int i;
0000 02636 ....................
0000 02637 .................... TRISB = 0xFF;
0622 30FF 02638 MOVLW FF
0623 1683 02639 BSF 03,5
0624 0086 02640 MOVWF 06
0660 30FF 02641 MOVLW FF
0661 1683 02642 BSF 03,5
0662 0086 02643 MOVWF 06
069E 30FF 02644 MOVLW FF
069F 1683 02645 BSF 03,5
06A0 0086 02646 MOVWF 06
06DC 30FF 02647 MOVLW FF
06DD 1683 02648 BSF 03,5
06DE 0086 02649 MOVWF 06
072F 30FF 02650 MOVLW FF
0730 1683 02651 BSF 03,5
0731 0086 02652 MOVWF 06
076D 30FF 02653 MOVLW FF
076E 1683 02654 BSF 03,5
076F 0086 02655 MOVWF 06
0796 30FF 02656 MOVLW FF
0797 1683 02657 BSF 03,5
0798 0086 02658 MOVWF 06
07D4 30FF 02659 MOVLW FF
07D5 1683 02660 BSF 03,5
07D6 0086 02661 MOVWF 06
0D52 30FF 02662 MOVLW FF
0D53 1683 02663 BSF 03,5
0D54 0086 02664 MOVWF 06
0D9E 30FF 02665 MOVLW FF
0D9F 1683 02666 BSF 03,5
0DA0 0086 02667 MOVWF 06
0DC8 30FF 02668 MOVLW FF
0DC9 1683 02669 BSF 03,5
0DCA 0086 02670 MOVWF 06
1743 30FF 02671 MOVLW FF
1744 1683 02672 BSF 03,5
1745 0086 02673 MOVWF 06
0000 02674 ....................
0000 02675 .................... DELAY_US(5);
0625 0000 02676 NOP
0626 0000 02677 NOP
0627 0000 02678 NOP
0628 0000 02679 NOP
0629 0000 02680 NOP
0663 0000 02681 NOP
0664 0000 02682 NOP
0665 0000 02683 NOP
0666 0000 02684 NOP
0667 0000 02685 NOP
06A1 0000 02686 NOP
06A2 0000 02687 NOP
06A3 0000 02688 NOP
06A4 0000 02689 NOP
06A5 0000 02690 NOP
06DF 0000 02691 NOP
06E0 0000 02692 NOP
06E1 0000 02693 NOP
06E2 0000 02694 NOP
06E3 0000 02695 NOP
0732 0000 02696 NOP
0733 0000 02697 NOP
0734 0000 02698 NOP
0735 0000 02699 NOP
0736 0000 02700 NOP
0770 0000 02701 NOP
0771 0000 02702 NOP
0772 0000 02703 NOP
0773 0000 02704 NOP
0774 0000 02705 NOP
0799 0000 02706 NOP
079A 0000 02707 NOP
079B 0000 02708 NOP
079C 0000 02709 NOP
079D 0000 02710 NOP
07D7 0000 02711 NOP
07D8 0000 02712 NOP
07D9 0000 02713 NOP
07DA 0000 02714 NOP
07DB 0000 02715 NOP
0D55 0000 02716 NOP
0D56 0000 02717 NOP
0D57 0000 02718 NOP
0D58 0000 02719 NOP
0D59 0000 02720 NOP
0DA1 0000 02721 NOP
0DA2 0000 02722 NOP
0DA3 0000 02723 NOP
0DA4 0000 02724 NOP
0DA5 0000 02725 NOP
0DCB 0000 02726 NOP
0DCC 0000 02727 NOP
0DCD 0000 02728 NOP
0DCE 0000 02729 NOP
0DCF 0000 02730 NOP
1746 0000 02731 NOP
1747 0000 02732 NOP
1748 0000 02733 NOP
1749 0000 02734 NOP
174A 0000 02735 NOP
0000 02736 ....................
0000 02737 .................... LCDDATA_H = 0x00;
062A 1283 02738 BCF 03,5
062B 1187 02739 BCF 07,3
0668 1283 02740 BCF 03,5
0669 1187 02741 BCF 07,3
06A6 1283 02742 BCF 03,5
06A7 1187 02743 BCF 07,3
06E4 1283 02744 BCF 03,5
06E5 1187 02745 BCF 07,3
0737 1283 02746 BCF 03,5
0738 1187 02747 BCF 07,3
0775 1283 02748 BCF 03,5
0776 1187 02749 BCF 07,3
079E 1283 02750 BCF 03,5
079F 1187 02751 BCF 07,3
07DC 1283 02752 BCF 03,5
07DD 1187 02753 BCF 07,3
0D5A 1283 02754 BCF 03,5
0D5B 1187 02755 BCF 07,3
0DA6 1283 02756 BCF 03,5
0DA7 1187 02757 BCF 07,3
0DD0 1283 02758 BCF 03,5
0DD1 1187 02759 BCF 07,3
174B 1283 02760 BCF 03,5
174C 1187 02761 BCF 07,3
0000 02762 .................... LCDRD_H = 0x01;
062C 1607 02763 BSF 07,4
066A 1607 02764 BSF 07,4
06A8 1607 02765 BSF 07,4
06E6 1607 02766 BSF 07,4
0739 1607 02767 BSF 07,4
0777 1607 02768 BSF 07,4
07A0 1607 02769 BSF 07,4
07DE 1607 02770 BSF 07,4
0D5C 1607 02771 BSF 07,4
0DA8 1607 02772 BSF 07,4
0DD2 1607 02773 BSF 07,4
174D 1607 02774 BSF 07,4
0000 02775 ....................
0000 02776 .................... i = 0x00;
062D 1703 02777 BSF 03,6
062E 01AD 02778 CLRF 2D
062F 1303 02779 BCF 03,6
066B 1703 02780 BSF 03,6
066C 01AD 02781 CLRF 2D
066D 1303 02782 BCF 03,6
06A9 1703 02783 BSF 03,6
06AA 01AD 02784 CLRF 2D
06AB 1303 02785 BCF 03,6
06E7 1703 02786 BSF 03,6
06E8 01AD 02787 CLRF 2D
06E9 1303 02788 BCF 03,6
073A 1703 02789 BSF 03,6
073B 01AD 02790 CLRF 2D
073C 1303 02791 BCF 03,6
0778 1703 02792 BSF 03,6
0779 01AD 02793 CLRF 2D
077A 1303 02794 BCF 03,6
07A1 1703 02795 BSF 03,6
07A2 01AD 02796 CLRF 2D
07A3 1303 02797 BCF 03,6
07DF 1703 02798 BSF 03,6
07E0 01AD 02799 CLRF 2D
07E1 1303 02800 BCF 03,6
0D5D 1703 02801 BSF 03,6
0D5E 01AD 02802 CLRF 2D
0D5F 1303 02803 BCF 03,6
0DA9 1703 02804 BSF 03,6
0DAA 01AD 02805 CLRF 2D
0DAB 1303 02806 BCF 03,6
0DD3 1703 02807 BSF 03,6
0DD4 01AD 02808 CLRF 2D
0DD5 1303 02809 BCF 03,6
174E 1703 02810 BSF 03,6
174F 01AD 02811 CLRF 2D
1750 1303 02812 BCF 03,6
0000 02813 ....................
0000 02814 ....................
0000 02815 .................... // LCDEN_L = 0x00;
0000 02816 ....................
0000 02817 .................... do {
0000 02818 .................... LCDEN_L = 0x01;
0630 1687 02819 BSF 07,5
066E 1687 02820 BSF 07,5
06AC 1687 02821 BSF 07,5
06EA 1687 02822 BSF 07,5
073D 1687 02823 BSF 07,5
077B 1687 02824 BSF 07,5
07A4 1687 02825 BSF 07,5
07E2 1687 02826 BSF 07,5
0D60 1687 02827 BSF 07,5
0DAC 1687 02828 BSF 07,5
0DD6 1687 02829 BSF 07,5
1751 1687 02830 BSF 07,5
0000 02831 .................... DELAY_US(50);
0631 3010 02832 MOVLW 10
0632 00F7 02833 MOVWF 77
0633 0BF7 02834 DECFSZ 77,F
0634 2E33 02835 GOTO 633
0635 0000 02836 NOP
066F 3010 02837 MOVLW 10
0670 00F7 02838 MOVWF 77
0671 0BF7 02839 DECFSZ 77,F
0672 2E71 02840 GOTO 671
0673 0000 02841 NOP
06AD 3010 02842 MOVLW 10
06AE 00F7 02843 MOVWF 77
06AF 0BF7 02844 DECFSZ 77,F
06B0 2EAF 02845 GOTO 6AF
06B1 0000 02846 NOP
06EB 3010 02847 MOVLW 10
06EC 00F7 02848 MOVWF 77
06ED 0BF7 02849 DECFSZ 77,F
06EE 2EED 02850 GOTO 6ED
06EF 0000 02851 NOP
073E 3010 02852 MOVLW 10
073F 00F7 02853 MOVWF 77
0740 0BF7 02854 DECFSZ 77,F
0741 2F40 02855 GOTO 740
0742 0000 02856 NOP
077C 3010 02857 MOVLW 10
077D 00F7 02858 MOVWF 77
077E 0BF7 02859 DECFSZ 77,F
077F 2F7E 02860 GOTO 77E
0780 0000 02861 NOP
07A5 3010 02862 MOVLW 10
07A6 00F7 02863 MOVWF 77
07A7 0BF7 02864 DECFSZ 77,F
07A8 2FA7 02865 GOTO 7A7
07A9 0000 02866 NOP
07E3 3010 02867 MOVLW 10
07E4 00F7 02868 MOVWF 77
07E5 0BF7 02869 DECFSZ 77,F
07E6 2FE5 02870 GOTO 7E5
07E7 0000 02871 NOP
0D61 3010 02872 MOVLW 10
0D62 00F7 02873 MOVWF 77
0D63 0BF7 02874 DECFSZ 77,F
0D64 2D63 02875 GOTO 563
0D65 0000 02876 NOP
0DAD 3010 02877 MOVLW 10
0DAE 00F7 02878 MOVWF 77
0DAF 0BF7 02879 DECFSZ 77,F
0DB0 2DAF 02880 GOTO 5AF
0DB1 0000 02881 NOP
0DD7 3010 02882 MOVLW 10
0DD8 00F7 02883 MOVWF 77
0DD9 0BF7 02884 DECFSZ 77,F
0DDA 2DD9 02885 GOTO 5D9
0DDB 0000 02886 NOP
1752 3010 02887 MOVLW 10
1753 00F7 02888 MOVWF 77
1754 0BF7 02889 DECFSZ 77,F
1755 2F54 02890 GOTO 754
1756 0000 02891 NOP
0000 02892 .................... LCDEN_L = 0x00;
0636 1287 02893 BCF 07,5
0674 1287 02894 BCF 07,5
06B2 1287 02895 BCF 07,5
06F0 1287 02896 BCF 07,5
0743 1287 02897 BCF 07,5
0781 1287 02898 BCF 07,5
07AA 1287 02899 BCF 07,5
07E8 1287 02900 BCF 07,5
0D66 1287 02901 BCF 07,5
0DB2 1287 02902 BCF 07,5
0DDC 1287 02903 BCF 07,5
1757 1287 02904 BCF 07,5
0000 02905 .................... DELAY_US(50);
0637 3010 02906 MOVLW 10
0638 00F7 02907 MOVWF 77
0639 0BF7 02908 DECFSZ 77,F
063A 2E39 02909 GOTO 639
063B 0000 02910 NOP
0675 3010 02911 MOVLW 10
0676 00F7 02912 MOVWF 77
0677 0BF7 02913 DECFSZ 77,F
0678 2E77 02914 GOTO 677
0679 0000 02915 NOP
06B3 3010 02916 MOVLW 10
06B4 00F7 02917 MOVWF 77
06B5 0BF7 02918 DECFSZ 77,F
06B6 2EB5 02919 GOTO 6B5
06B7 0000 02920 NOP
06F1 3010 02921 MOVLW 10
06F2 00F7 02922 MOVWF 77
06F3 0BF7 02923 DECFSZ 77,F
06F4 2EF3 02924 GOTO 6F3
06F5 0000 02925 NOP
0744 3010 02926 MOVLW 10
0745 00F7 02927 MOVWF 77
0746 0BF7 02928 DECFSZ 77,F
0747 2F46 02929 GOTO 746
0748 0000 02930 NOP
0782 3010 02931 MOVLW 10
0783 00F7 02932 MOVWF 77
0784 0BF7 02933 DECFSZ 77,F
0785 2F84 02934 GOTO 784
0786 0000 02935 NOP
07AB 3010 02936 MOVLW 10
07AC 00F7 02937 MOVWF 77
07AD 0BF7 02938 DECFSZ 77,F
07AE 2FAD 02939 GOTO 7AD
07AF 0000 02940 NOP
07E9 3010 02941 MOVLW 10
07EA 00F7 02942 MOVWF 77
07EB 0BF7 02943 DECFSZ 77,F
07EC 2FEB 02944 GOTO 7EB
07ED 0000 02945 NOP
0D67 3010 02946 MOVLW 10
0D68 00F7 02947 MOVWF 77
0D69 0BF7 02948 DECFSZ 77,F
0D6A 2D69 02949 GOTO 569
0D6B 0000 02950 NOP
0DB3 3010 02951 MOVLW 10
0DB4 00F7 02952 MOVWF 77
0DB5 0BF7 02953 DECFSZ 77,F
0DB6 2DB5 02954 GOTO 5B5
0DB7 0000 02955 NOP
0DDD 3010 02956 MOVLW 10
0DDE 00F7 02957 MOVWF 77
0DDF 0BF7 02958 DECFSZ 77,F
0DE0 2DDF 02959 GOTO 5DF
0DE1 0000 02960 NOP
1758 3010 02961 MOVLW 10
1759 00F7 02962 MOVWF 77
175A 0BF7 02963 DECFSZ 77,F
175B 2F5A 02964 GOTO 75A
175C 0000 02965 NOP
0000 02966 .................... i++;
063C 1703 02967 BSF 03,6
063D 0AAD 02968 INCF 2D,F
063E 1303 02969 BCF 03,6
067A 1703 02970 BSF 03,6
067B 0AAD 02971 INCF 2D,F
067C 1303 02972 BCF 03,6
06B8 1703 02973 BSF 03,6
06B9 0AAD 02974 INCF 2D,F
06BA 1303 02975 BCF 03,6
06F6 1703 02976 BSF 03,6
06F7 0AAD 02977 INCF 2D,F
06F8 1303 02978 BCF 03,6
0749 1703 02979 BSF 03,6
074A 0AAD 02980 INCF 2D,F
074B 1303 02981 BCF 03,6
0787 1703 02982 BSF 03,6
0788 0AAD 02983 INCF 2D,F
0789 1303 02984 BCF 03,6
07B0 1703 02985 BSF 03,6
07B1 0AAD 02986 INCF 2D,F
07B2 1303 02987 BCF 03,6
07EE 1703 02988 BSF 03,6
07EF 0AAD 02989 INCF 2D,F
07F0 1303 02990 BCF 03,6
0D6C 1703 02991 BSF 03,6
0D6D 0AAD 02992 INCF 2D,F
0D6E 1303 02993 BCF 03,6
0DB8 1703 02994 BSF 03,6
0DB9 0AAD 02995 INCF 2D,F
0DBA 1303 02996 BCF 03,6
0DE2 1703 02997 BSF 03,6
0DE3 0AAD 02998 INCF 2D,F
0DE4 1303 02999 BCF 03,6
175D 1703 03000 BSF 03,6
175E 0AAD 03001 INCF 2D,F
175F 1303 03002 BCF 03,6
0000 03003 .................... } while ((i < L_BusyTimeout_K) && LCDBusy_H);
063F 3005 03004 MOVLW 05
0640 1703 03005 BSF 03,6
0641 022D 03006 SUBWF 2D,W
0642 1C03 03007 BTFSS 03,0
0643 2E46 03008 GOTO 646
0644 1303 03009 BCF 03,6
0645 2E49 03010 GOTO 649
0646 1303 03011 BCF 03,6
0647 1B86 03012 BTFSC 06,7
0648 2E30 03013 GOTO 630
067D 3005 03014 MOVLW 05
067E 1703 03015 BSF 03,6
067F 022D 03016 SUBWF 2D,W
0680 1C03 03017 BTFSS 03,0
0681 2E84 03018 GOTO 684
0682 1303 03019 BCF 03,6
0683 2E87 03020 GOTO 687
0684 1303 03021 BCF 03,6
0685 1B86 03022 BTFSC 06,7
0686 2E6E 03023 GOTO 66E
06BB 3005 03024 MOVLW 05
06BC 1703 03025 BSF 03,6
06BD 022D 03026 SUBWF 2D,W
06BE 1C03 03027 BTFSS 03,0
06BF 2EC2 03028 GOTO 6C2
06C0 1303 03029 BCF 03,6
06C1 2EC5 03030 GOTO 6C5
06C2 1303 03031 BCF 03,6
06C3 1B86 03032 BTFSC 06,7
06C4 2EAC 03033 GOTO 6AC
06F9 3005 03034 MOVLW 05
06FA 1703 03035 BSF 03,6
06FB 022D 03036 SUBWF 2D,W
06FC 1C03 03037 BTFSS 03,0
06FD 2F00 03038 GOTO 700
06FE 1303 03039 BCF 03,6
06FF 2F03 03040 GOTO 703
0700 1303 03041 BCF 03,6
0701 1B86 03042 BTFSC 06,7
0702 2EEA 03043 GOTO 6EA
074C 3005 03044 MOVLW 05
074D 1703 03045 BSF 03,6
074E 022D 03046 SUBWF 2D,W
074F 1C03 03047 BTFSS 03,0
0750 2F53 03048 GOTO 753
0751 1303 03049 BCF 03,6
0752 2F56 03050 GOTO 756
0753 1303 03051 BCF 03,6
0754 1B86 03052 BTFSC 06,7
0755 2F3D 03053 GOTO 73D
078A 3005 03054 MOVLW 05
078B 1703 03055 BSF 03,6
078C 022D 03056 SUBWF 2D,W
078D 1C03 03057 BTFSS 03,0
078E 2F91 03058 GOTO 791
078F 1303 03059 BCF 03,6
0790 2F94 03060 GOTO 794
0791 1303 03061 BCF 03,6
0792 1B86 03062 BTFSC 06,7
0793 2F7B 03063 GOTO 77B
07B3 3005 03064 MOVLW 05
07B4 1703 03065 BSF 03,6
07B5 022D 03066 SUBWF 2D,W
07B6 1C03 03067 BTFSS 03,0
07B7 2FBA 03068 GOTO 7BA
07B8 1303 03069 BCF 03,6
07B9 2FBD 03070 GOTO 7BD
07BA 1303 03071 BCF 03,6
07BB 1B86 03072 BTFSC 06,7
07BC 2FA4 03073 GOTO 7A4
07F1 3005 03074 MOVLW 05
07F2 1703 03075 BSF 03,6
07F3 022D 03076 SUBWF 2D,W
07F4 1C03 03077 BTFSS 03,0
07F5 2FF8 03078 GOTO 7F8
07F6 1303 03079 BCF 03,6
07F7 2FFB 03080 GOTO 7FB
07F8 1303 03081 BCF 03,6
07F9 1B86 03082 BTFSC 06,7
07FA 2FE2 03083 GOTO 7E2
0D6F 3005 03084 MOVLW 05
0D70 1703 03085 BSF 03,6
0D71 022D 03086 SUBWF 2D,W
0D72 1C03 03087 BTFSS 03,0
0D73 2D76 03088 GOTO 576
0D74 1303 03089 BCF 03,6
0D75 2D79 03090 GOTO 579
0D76 1303 03091 BCF 03,6
0D77 1B86 03092 BTFSC 06,7
0D78 2D60 03093 GOTO 560
0DBB 3005 03094 MOVLW 05
0DBC 1703 03095 BSF 03,6
0DBD 022D 03096 SUBWF 2D,W
0DBE 1C03 03097 BTFSS 03,0
0DBF 2DC2 03098 GOTO 5C2
0DC0 1303 03099 BCF 03,6
0DC1 2DC5 03100 GOTO 5C5
0DC2 1303 03101 BCF 03,6
0DC3 1B86 03102 BTFSC 06,7
0DC4 2DAC 03103 GOTO 5AC
0DE5 3005 03104 MOVLW 05
0DE6 1703 03105 BSF 03,6
0DE7 022D 03106 SUBWF 2D,W
0DE8 1C03 03107 BTFSS 03,0
0DE9 2DEC 03108 GOTO 5EC
0DEA 1303 03109 BCF 03,6
0DEB 2DEF 03110 GOTO 5EF
0DEC 1303 03111 BCF 03,6
0DED 1B86 03112 BTFSC 06,7
0DEE 2DD6 03113 GOTO 5D6
1760 3005 03114 MOVLW 05
1761 1703 03115 BSF 03,6
1762 022D 03116 SUBWF 2D,W
1763 1C03 03117 BTFSS 03,0
1764 2F67 03118 GOTO 767
1765 1303 03119 BCF 03,6
1766 2F6A 03120 GOTO 76A
1767 1303 03121 BCF 03,6
1768 1B86 03122 BTFSC 06,7
1769 2F51 03123 GOTO 751
0000 03124 ....................
0000 03125 .................... LCDEN_L = 0x01;
0649 1687 03126 BSF 07,5
0687 1687 03127 BSF 07,5
06C5 1687 03128 BSF 07,5
0703 1687 03129 BSF 07,5
0756 1687 03130 BSF 07,5
0794 1687 03131 BSF 07,5
07BD 1687 03132 BSF 07,5
07FB 1687 03133 BSF 07,5
0D79 1687 03134 BSF 07,5
0DC5 1687 03135 BSF 07,5
0DEF 1687 03136 BSF 07,5
176A 1687 03137 BSF 07,5
0000 03138 .................... LCDRD_H = 0x00;
064A 1207 03139 BCF 07,4
0688 1207 03140 BCF 07,4
06C6 1207 03141 BCF 07,4
0704 1207 03142 BCF 07,4
0757 1207 03143 BCF 07,4
0795 1207 03144 BCF 07,4
07BE 1207 03145 BCF 07,4
07FC 1207 03146 BCF 07,4
0D7A 1207 03147 BCF 07,4
0DC6 1207 03148 BCF 07,4
0DF0 1207 03149 BCF 07,4
176B 1207 03150 BCF 07,4
0000 03151 ....................
0000 03152 .................... }
0000 03153 ....................

And an other example:

0000 03155 .................... #INLINE
0000 03156 .................... void L_Write_S(char Dato) {
0000 03157 ....................

There was a long comment, here.

0000 03175 ....................
0000 03176 .................... #asm
0000 03177 ....................
0000 03178 .................... bcf INTCON, 5
05DC 1303 03179 BCF 03,6
05DD 128B 03180 BCF 0B,5
05F6 1303 03181 BCF 03,6
05F7 128B 03182 BCF 0B,5
0610 1303 03183 BCF 03,6
0611 128B 03184 BCF 0B,5
064E 1303 03185 BCF 03,6
064F 128B 03186 BCF 0B,5
068C 1303 03187 BCF 03,6
068D 128B 03188 BCF 0B,5
06CA 1303 03189 BCF 03,6
06CB 128B 03190 BCF 0B,5
0708 1303 03191 BCF 03,6
0709 128B 03192 BCF 0B,5
071D 1303 03193 BCF 03,6
071E 128B 03194 BCF 0B,5
075B 1303 03195 BCF 03,6
075C 128B 03196 BCF 0B,5
07C2 1303 03197 BCF 03,6
07C3 128B 03198 BCF 0B,5
0D8C 1303 03199 BCF 03,6
0D8D 128B 03200 BCF 0B,5
0E09 1303 03201 BCF 03,6
0E0A 128B 03202 BCF 0B,5
176F 1303 03203 BCF 03,6
1770 128B 03204 BCF 0B,5
0000 03205 ....................
0000 03206 .................... movlw PortBWrite_K
05DE 3000 03207 MOVLW 00
05F8 3000 03208 MOVLW 00
0612 3000 03209 MOVLW 00
0650 3000 03210 MOVLW 00
068E 3000 03211 MOVLW 00
06CC 3000 03212 MOVLW 00
070A 3000 03213 MOVLW 00
071F 3000 03214 MOVLW 00
075D 3000 03215 MOVLW 00
07C4 3000 03216 MOVLW 00
0D8E 3000 03217 MOVLW 00
0E0B 3000 03218 MOVLW 00
1771 3000 03219 MOVLW 00
0000 03220 .................... movwf TRISB
05DF 1683 03221 BSF 03,5
05E0 0086 03222 MOVWF 06
05F9 1683 03223 BSF 03,5
05FA 0086 03224 MOVWF 06
0613 1683 03225 BSF 03,5
0614 0086 03226 MOVWF 06
0651 1683 03227 BSF 03,5
0652 0086 03228 MOVWF 06
068F 1683 03229 BSF 03,5
0690 0086 03230 MOVWF 06
06CD 1683 03231 BSF 03,5
06CE 0086 03232 MOVWF 06
070B 1683 03233 BSF 03,5
070C 0086 03234 MOVWF 06
0720 1683 03235 BSF 03,5
0721 0086 03236 MOVWF 06
075E 1683 03237 BSF 03,5
075F 0086 03238 MOVWF 06
07C5 1683 03239 BSF 03,5
07C6 0086 03240 MOVWF 06
0D8F 1683 03241 BSF 03,5
0D90 0086 03242 MOVWF 06
0E0C 1683 03243 BSF 03,5
0E0D 0086 03244 MOVWF 06
1772 1683 03245 BSF 03,5
1773 0086 03246 MOVWF 06
0000 03247 ....................
0000 03248 .................... movf Dato, 0
05E1 1283 03249 BCF 03,5
05E2 1703 03250 BSF 03,6
05E3 082D 03251 MOVF 2D,W
05FB 1283 03252 BCF 03,5
05FC 1703 03253 BSF 03,6
05FD 082D 03254 MOVF 2D,W
0615 1283 03255 BCF 03,5
0616 1703 03256 BSF 03,6
0617 082D 03257 MOVF 2D,W
0653 1283 03258 BCF 03,5
0654 1703 03259 BSF 03,6
0655 082D 03260 MOVF 2D,W
0691 1283 03261 BCF 03,5
0692 1703 03262 BSF 03,6
0693 082D 03263 MOVF 2D,W
06CF 1283 03264 BCF 03,5
06D0 1703 03265 BSF 03,6
06D1 082D 03266 MOVF 2D,W
070D 1283 03267 BCF 03,5
070E 1703 03268 BSF 03,6
070F 082D 03269 MOVF 2D,W
0722 1283 03270 BCF 03,5
0723 1703 03271 BSF 03,6
0724 082D 03272 MOVF 2D,W
0760 1283 03273 BCF 03,5
0761 1703 03274 BSF 03,6
0762 082D 03275 MOVF 2D,W
07C7 1283 03276 BCF 03,5
07C8 1703 03277 BSF 03,6
07C9 082D 03278 MOVF 2D,W
0D91 1283 03279 BCF 03,5
0D92 1703 03280 BSF 03,6
0D93 082D 03281 MOVF 2D,W
0E0E 1283 03282 BCF 03,5
0E0F 1703 03283 BSF 03,6
0E10 082D 03284 MOVF 2D,W
1774 1283 03285 BCF 03,5
1775 1703 03286 BSF 03,6
1776 082D 03287 MOVF 2D,W
0000 03288 .................... movwf PORTB
05E4 1303 03289 BCF 03,6
05E5 0086 03290 MOVWF 06
05FE 1303 03291 BCF 03,6
05FF 0086 03292 MOVWF 06
0618 1303 03293 BCF 03,6
0619 0086 03294 MOVWF 06
0656 1303 03295 BCF 03,6
0657 0086 03296 MOVWF 06
0694 1303 03297 BCF 03,6
0695 0086 03298 MOVWF 06
06D2 1303 03299 BCF 03,6
06D3 0086 03300 MOVWF 06
0710 1303 03301 BCF 03,6
0711 0086 03302 MOVWF 06
0725 1303 03303 BCF 03,6
0726 0086 03304 MOVWF 06
0763 1303 03305 BCF 03,6
0764 0086 03306 MOVWF 06
07CA 1303 03307 BCF 03,6
07CB 0086 03308 MOVWF 06
0D94 1303 03309 BCF 03,6
0D95 0086 03310 MOVWF 06
0E11 1303 03311 BCF 03,6
0E12 0086 03312 MOVWF 06
1777 1303 03313 BCF 03,6
1778 0086 03314 MOVWF 06
0000 03315 ....................
0000 03316 .................... bcf PORTC, 5
05E6 1287 03317 BCF 07,5
0600 1287 03318 BCF 07,5
061A 1287 03319 BCF 07,5
0658 1287 03320 BCF 07,5
0696 1287 03321 BCF 07,5
06D4 1287 03322 BCF 07,5
0712 1287 03323 BCF 07,5
0727 1287 03324 BCF 07,5
0765 1287 03325 BCF 07,5
07CC 1287 03326 BCF 07,5
0D96 1287 03327 BCF 07,5
0E13 1287 03328 BCF 07,5
1779 1287 03329 BCF 07,5
0000 03330 .................... bsf PORTC, 5
05E7 1687 03331 BSF 07,5
0601 1687 03332 BSF 07,5
061B 1687 03333 BSF 07,5
0659 1687 03334 BSF 07,5
0697 1687 03335 BSF 07,5
06D5 1687 03336 BSF 07,5
0713 1687 03337 BSF 07,5
0728 1687 03338 BSF 07,5
0766 1687 03339 BSF 07,5
07CD 1687 03340 BSF 07,5
0D97 1687 03341 BSF 07,5
0E14 1687 03342 BSF 07,5
177A 1687 03343 BSF 07,5
0000 03344 ....................
0000 03345 .................... bcf PORTC, 3
05E8 1187 03346 BCF 07,3
0602 1187 03347 BCF 07,3
061C 1187 03348 BCF 07,3
065A 1187 03349 BCF 07,3
0698 1187 03350 BCF 07,3
06D6 1187 03351 BCF 07,3
0714 1187 03352 BCF 07,3
0729 1187 03353 BCF 07,3
0767 1187 03354 BCF 07,3
07CE 1187 03355 BCF 07,3
0D98 1187 03356 BCF 07,3
0E15 1187 03357 BCF 07,3
177B 1187 03358 BCF 07,3
0000 03359 ....................
0000 03360 .................... movlw PortBRead_K
05E9 30FF 03361 MOVLW FF
0603 30FF 03362 MOVLW FF
061D 30FF 03363 MOVLW FF
065B 30FF 03364 MOVLW FF
0699 30FF 03365 MOVLW FF
06D7 30FF 03366 MOVLW FF
0715 30FF 03367 MOVLW FF
072A 30FF 03368 MOVLW FF
0768 30FF 03369 MOVLW FF
07CF 30FF 03370 MOVLW FF
0D99 30FF 03371 MOVLW FF
0E16 30FF 03372 MOVLW FF
177C 30FF 03373 MOVLW FF
0000 03374 .................... movwf TRISB
05EA 1683 03375 BSF 03,5
05EB 0086 03376 MOVWF 06
0604 1683 03377 BSF 03,5
0605 0086 03378 MOVWF 06
061E 1683 03379 BSF 03,5
061F 0086 03380 MOVWF 06
065C 1683 03381 BSF 03,5
065D 0086 03382 MOVWF 06
069A 1683 03383 BSF 03,5
069B 0086 03384 MOVWF 06
06D8 1683 03385 BSF 03,5
06D9 0086 03386 MOVWF 06
0716 1683 03387 BSF 03,5
0717 0086 03388 MOVWF 06
072B 1683 03389 BSF 03,5
072C 0086 03390 MOVWF 06
0769 1683 03391 BSF 03,5
076A 0086 03392 MOVWF 06
07D0 1683 03393 BSF 03,5
07D1 0086 03394 MOVWF 06
0D9A 1683 03395 BSF 03,5
0D9B 0086 03396 MOVWF 06
0E17 1683 03397 BSF 03,5
0E18 0086 03398 MOVWF 06
177D 1683 03399 BSF 03,5
177E 0086 03400 MOVWF 06
0000 03401 ....................
0000 03402 .................... bsf INTCON, 5
0000 03403 ....................
0000 03404 .................... #endasm
05EC 1283 03405 BCF 03,5
05ED 168B 03406 BSF 0B,5
0606 1283 03407 BCF 03,5
0607 168B 03408 BSF 0B,5
0620 1283 03409 BCF 03,5
0621 168B 03410 BSF 0B,5
065E 1283 03411 BCF 03,5
065F 168B 03412 BSF 0B,5
069C 1283 03413 BCF 03,5
069D 168B 03414 BSF 0B,5
06DA 1283 03415 BCF 03,5
06DB 168B 03416 BSF 0B,5
0718 1283 03417 BCF 03,5
0719 168B 03418 BSF 0B,5
072D 1283 03419 BCF 03,5
072E 168B 03420 BSF 0B,5
076B 1283 03421 BCF 03,5
076C 168B 03422 BSF 0B,5
07D2 1283 03423 BCF 03,5
07D3 168B 03424 BSF 0B,5
0D9C 1283 03425 BCF 03,5
0D9D 168B 03426 BSF 0B,5
0E19 1283 03427 BCF 03,5
0E1A 168B 03428 BSF 0B,5
177F 1283 03429 BCF 03,5
1780 168B 03430 BSF 0B,5
0000 03431 ....................
0000 03432 .................... }
0000 03433 ....................

If you need something other, please ask ;)

Thanks,
Axl

P.S.: Yes, I've seen that
#asm
nop
#endasm
is compiled well... It's a mistake of mine because one of the error I got from compiler was that a
#asm
nop
nop
nop
nop
nop
#endasm
in my code produced sixty 'nop' opcode in listing file...

Please, accept my apologizes.

Best regards,
Axl
___________________________
This message was ported from CCS's old forum
Original Post ID: 1272
Felix Althaus



Joined: 09 Sep 2003
Posts: 67
Location: Winterthur, Switzerland

View user's profile Send private message

Re: if I compile ASM code I got several times the same opcod
PostPosted: Wed Nov 21, 2001 8:46 am     Reply with quote

Hi

Just a short question (only what I would try): What happends if you use the functions as #separate instead of #inline or if you leave out this directives?

mfg
Felix
___________________________
This message was ported from CCS's old forum
Original Post ID: 1275
Axl
Guest







Re: if I compile ASM code I got several times the same opcod
PostPosted: Wed Nov 21, 2001 6:35 pm     Reply with quote

:=Hi
:=
:=Just a short question (only what I would try): What happends if you use the functions as #separate instead of #inline or if you leave out this directives?
:=
:=mfg
:=Felix

I've tried this way just after I've seen the other thread began with mine (multiple unnessessary calls), that was a problem that I've seen in my code.
Multiplied code disappears.

Thanks to all! Smile
Axl
___________________________
This message was ported from CCS's old forum
Original Post ID: 1283
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group