?? main.lst
字號:
C51 COMPILER V8.02 MAIN 06/27/2007 20:01:46 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include <reg52.h>
2
3 //接口定義
4 sbit DA = P1^1;
5 sbit CK = P1^2;
6 sbit CS = P1^4;
7
8 //10bit取樣,1024點正弦查表數據
9 unsigned int code sine_dot[1024]=
10 {
11 0x200,0x203,0x206,0x209,0x20c,0x20f,0x212,0x215,0x219,0x21c,0x21f,0x222,0x225,0x228,0x22b,0x22f,0x232,
12 0x235,0x238,0x23b,0x23e,0x241,0x244,0x247,0x24b,0x24e,0x251,0x254,0x257,0x25a,0x25d,0x260,0x263,0x266,0x26
-9,0x26d,0x270,
13 0x273,0x276,0x279,0x27c,0x27f,0x282,0x285,0x288,0x28b,0x28e,0x291,0x294,0x297,0x29a,0x29d,0x2a0,0x2a3,0x2a
-6,0x2a9,0x2ac,
14 0x2af,0x2b2,0x2b5,0x2b8,0x2bb,0x2be,0x2c0,0x2c3,0x2c6,0x2c9,0x2cc,0x2cf,0x2d2,0x2d5,0x2d7,0x2da,0x2dd,0x2e
-0,0x2e3,0x2e6,
15 0x2e8,0x2eb,0x2ee,0x2f1,0x2f4,0x2f6,0x2f9,0x2fc,0x2fe,0x301,0x304,0x307,0x309,0x30c,0x30f,0x311,0x314,0x31
-7,0x319,0x31c,
16 0x31e,0x321,0x324,0x326,0x329,0x32b,0x32e,0x330,0x333,0x335,0x338,0x33a,0x33d,0x33f,0x342,0x344,0x347,0x34
-9,0x34b,0x34e,
17 0x350,0x353,0x355,0x357,0x35a,0x35c,0x35e,0x360,0x363,0x365,0x367,0x369,0x36c,0x36e,0x370,0x372,0x374,0x37
-6,0x379,0x37b,
18 0x37d,0x37f,0x381,0x383,0x385,0x387,0x389,0x38b,0x38d,0x38f,0x391,0x393,0x395,0x397,0x399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3dd,0x3dc,0x3db,0x3da,0x3d9,0x3d8,0x3d6,0x3d5,0x3d4,0x3d3,0x3d1,0x3d0,0x3cf,0x3cd,0x3cc,0x3ca,0x3c
-9,0x3c8,0x3c6,
28 0x3c5,0x3c3,0x3c2,0x3c0,0x3bf,0x3bd,0x3bc,0x3ba,0x3b9,0x3b7,0x3b5,0x3b4,0x3b2,0x3b0,0x3af,0x3ad,0x3ab,0x3a
-a,0x3a8,0x3a6,
29 0x3a4,0x3a2,0x3a1,0x39f,0x39d,0x39b,0x399,0x397,0x395,0x393,0x392,0x390,0x38e,0x38c,0x38a,0x388,0x386,0x38
-4,0x382,0x37f,
30 0x37d,0x37b,0x379,0x377,0x375,0x373,0x371,0x36e,0x36c,0x36a,0x368,0x366,0x363,0x361,0x35f,0x35c,0x35a,0x35
-8,0x355,0x353,
31 0x351,0x34e,0x34c,0x34a,0x347,0x345,0x342,0x340,0x33d,0x33b,0x339,0x336,0x334,0x331,0x32e,0x32c,0x329,0x32
-7,0x324,0x322,
32 0x31f,0x31d,0x31a,0x317,0x315,0x312,0x30f,0x30d,0x30a,0x307,0x305,0x302,0x2ff,0x2fc,0x2fa,0x2f7,0x2f4,0x2f
-1,0x2ef,0x2ec,
33 0x2e9,0x2e6,0x2e4,0x2e1,0x2de,0x2db,0x2d8,0x2d5,0x2d2,0x2d0,0x2cd,0x2ca,0x2c7,0x2c4,0x2c1,0x2be,0x2bb,0x2b
-8,0x2b6,0x2b3,
C51 COMPILER V8.02 MAIN 06/27/2007 20:01:46 PAGE 2
34 0x2b0,0x2ad,0x2aa,0x2a7,0x2a4,0x2a1,0x29e,0x29b,0x298,0x295,0x292,0x28f,0x28c,0x289,0x286,0x283,0x280,0x27
-d,0x27a,0x277,
35 0x273,0x270,0x26d,0x26a,0x267,0x264,0x261,0x25e,0x25b,0x258,0x255,0x252,0x24e,0x24b,0x248,0x245,0x242,0x23
-f,0x23c,0x239,
36 0x236,0x232,0x22f,0x22c,0x229,0x226,0x223,0x220,0x21d,0x219,0x216,0x213,0x210,0x20d,0x20a,0x207,0x203,0x20
-0,0x1fd,0x1fa,
37 0x1f7,0x1f4,0x1f1,0x1ed,0x1ea,0x1e7,0x1e4,0x1e1,0x1de,0x1db,0x1d8,0x1d4,0x1d1,0x1ce,0x1cb,0x1c8,0x1c5,0x1c
-2,0x1bf,0x1bb,
38 0x1b8,0x1b5,0x1b2,0x1af,0x1ac,0x1a9,0x1a6,0x1a3,0x1a0,0x19c,0x199,0x196,0x193,0x190,0x18d,0x18a,0x187,0x18
-4,0x181,0x17e,
39 0x17b,0x178,0x175,0x172,0x16f,0x16c,0x169,0x166,0x163,0x160,0x15d,0x15a,0x157,0x154,0x151,0x14e,0x14b,0x14
-8,0x145,0x142,
40 0x13f,0x13c,0x13a,0x137,0x134,0x131,0x12e,0x12b,0x128,0x125,0x123,0x120,0x11d,0x11a,0x117,0x115,0x112,0x10
-f,0x10c,0x109,
41 0x107,0x104,0x101,0xff,0xfc,0xf9,0xf6,0xf4,0xf1,0xee,0xec,0xe9,0xe6,0xe4,0xe1,0xdf,0xdc,0xd9,0xd7,0xd4,0xd
-2,0xcf,0xcd,
42 0xca,0xc8,0xc5,0xc3,0xc0,0xbe,0xbb,0xb9,0xb7,0xb4,0xb2,0xaf,0xad,0xab,0xa8,0xa6,0xa4,0xa1,0x9f,0x9d,0x9b,0
-x98,0x96,0x94,
43 0x92,0x90,0x8d,0x8b,0x89,0x87,0x85,0x83,0x81,0x7f,0x7c,0x7a,0x78,0x76,0x74,0x72,0x70,0x6e,0x6d,0x6b,0x69,0
-x67,0x65,0x63,
44 0x61,0x5f,0x5e,0x5c,0x5a,0x58,0x56,0x55,0x53,0x51,0x50,0x4e,0x4c,0x4b,0x49,0x47,0x46,0x44,0x43,0x41,0x3f,0
-x3e,0x3c,0x3b,
45 0x3a,0x38,0x37,0x35,0x34,0x32,0x31,0x30,0x2e,0x2d,0x2c,0x2b,0x29,0x28,0x27,0x26,0x25,0x23,0x22,0x21,0x20,0
-x1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,0x102,0x105,0x107,0x1
-0a,0x10d,0x110,
55 0x112,0x115,0x118,0x11b,0x11e,0x120,0x123,0x126,0x129,0x12c,0x12f,0x131,0x134,0x137,0x13a,0x13d,0x140,0x14
-3,0x146,0x149,
56 0x14c,0x14f,0x152,0x155,0x157,0x15a,0x15d,0x160,0x163,0x166,0x169,0x16c,0x16f,0x172,0x175,0x178,0x17b,0x17
-f,0x182,0x185,
57 0x188,0x18b,0x18e,0x191,0x194,0x197,0x19a,0x19d,0x1a0,0x1a3,0x1a6,0x1a9,0x1ad,0x1b0,0x1b3,0x1b6,0x1b9,0x1b
-c,0x1bf,0x1c2,
58 0x1c5,0x1c9,0x1cc,0x1cf,0x1d2,0x1d5,0x1d8,0x1db,0x1de,0x1e2,0x1e5,0x1e8,0x1eb,0x1ee,0x1f1,0x1f4,0x1f8,0x1f
-b
59 };
60
61
62 //數據寫入
63 void da5615(unsigned int da)
64 {
65 1 unsigned char i;
66 1 da <<= 6;//10有效數據左對齊
67 1 CS = 0;
68 1 CK = 0;
69 1 for (i=0;i<12;i++)
70 1 {
C51 COMPILER V8.02 MAIN 06/27/2007 20:01:46 PAGE 3
71 2 DA = (bit)(da & 0x8000);
72 2 CK = 1;
73 2 da <<= 1;
74 2 CK = 0;
75 2 }
76 1 CS = 1;
77 1 CK = 0;
78 1 }
79
80 main()
81 {
82 1 unsigned int j;
83 1 while(1)
84 1 {
85 2 da5615(sine_dot[j]);
86 2 if(++j > 1023) j=0;
87 2 }
88 1 }
89
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 94 ----
CONSTANT SIZE = 2048 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 2
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -