C all'Assemblea di conversione

I

Ibrar

Guest
Ciao a tutti

può un corpo di convertire i seguenti codici per l'assemblaggio.Questi codici sono per jhd12864 GLCD.

Grazie

# include <reg51.h>
# include <intrins.h>
UCHAR typedef unsigned char;
typedef unsigned int uint;
sbit L_DI = P2 ^ 0;
sbit L_RW = P2 ^ 1;
sbit L_E = P2 ^ 4;
sbit L_CS1 = P2 ^ 6;
sbit L_CS2 = P2 ^ 7;
sbit L_SET = P2 ^ 3;
sbit TEST = P3 ^ 5;
float abc;
X1 codice UCHAR [] = (
0x30, 0x50, 0xd0, 0x90, 0xF0, 0x30, 0x80, 0x60, 0x3C, 0xE8, 0x20, 0xA0, 0XE0, 0x70, 0x00, 0x00,
0x04, 0x06, 0x03, 0x11, 0x13, 0x12, 0x18, 0x0c, 0x07, 0x01, 0x03, 0x06, 0x0c, 0x1C, 0x18, 0x18
); /*?*/
X2 codice UCHAR [] = (
0x40, 0x58, 0x58, 0xd0, 0x10, 0xf8, 0x98, 0x08, 0x88, 0xf8, 0xF0, 0x10, 0xf8, 0x70, 0x00, 0x00,
0x0c, 0x04, 0x04, 0x07, 0x04, 0x05, 0x0D, 0x0D, 0x08, 0x1f, 0x1b, 0x19, 0x38, 0x38, 0x18, 0x18
); /*?*/
X3 codice UCHAR [] = (
0x30, 0x30, 0xf8, 0xf8, 0x08, 0x10, 0xd0, 0x50, 0x50, 0xFC, 0xFC, 0x50, 0xd0, 0xF0, 0x10, 0x00,
0x00, 0x00, 0x1F, 0x1F, 0x10, 0x10, 0x13, 0x1b, 0x0F, 0x07, 0x05, 0x0D, 0x09, 0x19, 0x38, 0x18

); /*?*/
X4 codice UCHAR [] = (
0x00, 0x00, 0x00, 0x00, 0xFC, 0xf8, 0x48, 0x48, 0x48, 0xf8, 0xf8, 0x48, 0x48, 0x48, 0xFC, 0xf8,
0x10, 0x10, 0x18, 0x1E, 0x0F, 0x01, 0x01, 0x01, 0x01, 0x3f, 0x1f, 0x01, 0x01, 0x01, 0x3f, 0x3f
); /*?*/
X5 codice UCHAR [] = (
0x18, 0xFC, 0x08, 0x48, 0x48, 0xB8, 0xd8, 0x58, 0xE8, 0xB8, 0xB8, 0x08, 0x08, 0xf8, 0xf8, 0x00,
0x00, 0x1f, 0x11, 0x11, 0x11, 0x14, 0x15, 0x16, 0x16, 0x10, 0x11, 0x11, 0x11, 0x3f, 0x1f, 0x00
); /*?*/
X6 codice UCHAR [] = (
0xC0, 0xC8, 0xC8, 0xf8, 0xf8, 0xC8, 0xf8, 0xf8, 0xC8, 0xC8, 0x00, 0x10, 0x90, 0xd8, 0x48, 0x48,
0x18, 0x18, 0x0c, 0x0F, 0x03, 0x00, 0x1F, 0x1F, 0x10, 0x10, 0x11, 0x19, 0x18, 0x0c, 0x04, 0x06
); /*?*/
X7 codice UCHAR [] = (
0x00, 0x00, 0x00, 0XE0, 0XE0, 0x40, 0x40, 0x7C, 0x7C, 0x58, 0x58, 0x58, 0xd0, 0xd0, 0x00, 0x00,
0x10, 0x18, 0x08, 0x0D, 0x03, 0x19, 0x0D, 0x01, 0x01, 0x0D, 0x19, 0x01, 0x07, 0x0c, 0x18, 0x38
); /*?*/
X8 codice UCHAR [] = (
0x08, 0xf8, 0xf8, 0x48, 0xE8, 0x98, 0x90, 0xd8, 0xF0, 0xbc, 0xFC, 0xd0, 0x90, 0x90, 0x90, 0x10,
0x00, 0x3f, 0x1f, 0x02, 0x03, 0x05, 0x06, 0x07, 0x07, 0x06, 0x3f, 0x3f, 0x06, 0x06, 0x04, 0x04
); /*?*/
X9 codice UCHAR [] = (
0x10, 0x08, 0x1C, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x08, 0x04, 0x04, 0x98, 0xF0, 0x00,
0x80, 0x80, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0XE0, 0x90, 0x8A, 0x83, 0xC1, 0x00
); / * 12 * /
X10 codice UCHAR [] = (
0x00, 0x78, 0xC8, 0x84, 0x04, 0x84, 0xf8, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80,
0x00, 0x78, 0x84, 0x83, 0x83, 0x8E, 0xFC, 0x40, 0x00, 0x80, 0x63, 0x17, 0x1C, 0xF2, 0xC1, 0x80
); / * 8x * /
X11 codice UCHAR [] = (
0x00, 0x80, 0XE0, 0x10, 0x08, 0x04, 0x04, 0x00, 0x00, 0x00, 0x80, 0x60, 0x10, 0xf8, 0x00, 0x00,
0x00, 0x7f, 0xC2, 0x81, 0x81, 0x81, 0x7f, 0x18, 0x00, 0x0e, 0x09, 0x08, 0x08, 0xff, 0x08, 0x08
); / * 64 * /
X12 codice UCHAR [] = (
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA,
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA
); /*....*/
X13 codice UCHAR [] = (
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
); /*??*/
X14 codice UCHAR [] = (
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
); /*??*/
X15 codice UCHAR [] = (

0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
); /*??*/
X16 codice UCHAR [] = (
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
); /*??*/
X17 codice UCHAR [] = (
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
); /*??*/
X18 codice UCHAR [] = (
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff
); /*??*/
X19 codice UCHAR [] = (
0xff, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
); /*??*/
UCHAR codice X20 [] = (
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff
); /*??*/
X21 codice UCHAR [] = (
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
); /*??*/
X22 codice UCHAR [] = (
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xff
); /*??*/
X23 codice UCHAR [] = (
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
); /*??*/
# pragma REGISTERBANK (0)
void initcomm (void)
(
PCON = 0x80; TMOD = 0x21; SCON = 0x50;
TH1 = 0xFA; TL1 = 0xFA; TR1 = 1; ES = 1;
TH0 = 0; TL0 = 0; tr0 = 1; ET0 = 1;
EA = 0;
)
void delay (void)
(
UCHAR i, j;

abc = 0,1 * 5;
for (i = 0; i! = 0xff; i )
for (j = 0; j! = 0xff; j );
)
void LCD_C_D (flag bit, ldata UCHAR) / * = 1 bandiera con flag = 0 dati * /
(
UCHAR i dati;
L_DI =! Bandiera; L_E = 0; L_RW = 0; P0 = ldata;
_nop_ ();
L_E = 1;
_nop_ (); _nop_ ();
L_E = 0; L_RW = 1; L_DI = 1;
for (i = 0; i <10; i );
)

void dis_one_zi (UCHAR x_add, UCHAR y_add, codice UCHAR * PO)
(
UCHAR i, j, w;
j = x_add * 2 0 xb8;
w = (y_add <4? y_add: y_add-4) * 16 0 x40;
L_CS1 = (y_add <4);
L_CS2 =! (Y_add <4);
LCD_C_D (1, j);
LCD_C_D (1, w);
for (i = 0; i <32; i )
(
if (i == 16)
(
LCD_C_D (1, j 1);
LCD_C_D (1, w);
)
LCD_C_D (0, * po );
)
L_CS1 = L_CS2 = 0;
)
void CLRLCD (numero UCHAR)
(
UCHAR dati i, j;
L_CS1 = L_CS2 = 1;
for (i = 0xB8; i <0xC0; i )
(
LCD_C_D (1, i);
LCD_C_D (1,0 X40);
for (j = 0; j <0x40; j )
LCD_C_D (0, numero);
)
L_CS1 = L_CS2 = 0;
)
void main (void) utilizzando 0
(
UCHAR dati i, j, il numero;
UCHAR codice * p;
initcomm ();
L_SET = 0;
for (j = 0; j! = 0xff; j );
L_SET = 1;
for (j = 0; j! = 0xff; j );
LCD_C_D (1,0 x3e );/**/
LCD_C_D (1,0 xc0 );/**/
LCD_C_D (1,0 X3F );/**/
CLRLCD (0);
while (1)
(
CLRLCD (0);
LCD_C_D (1,0 x3e);
X15 p = ;/*????*/
for (number = 1; numero <7; numero )
(Dis_one_zi (0, numero, p);)
p = X16;
for (number = 1; numero <7; numero )
(Dis_one_zi (3, numero, p);)
p = X17;
for (number = 1; numero <3; numero )
(Dis_one_zi (numero, 0, p);)
p = X18;
for (number = 1; numero <3; numero )
(Dis_one_zi (numero, 7, p);)
/*???*/
X19 = p; dis_one_zi (0,0, p);
p = X20; dis_one_zi (0,7, p);
X21 = p; dis_one_zi (3,0, p);
X22 = p; dis_one_zi (3,7, p);
/*????*/
X1 = p; dis_one_zi (1,1, p);
X2 = p; dis_one_zi (1,2, p);
X3 = p; dis_one_zi (1,3, p);
X4 = p; dis_one_zi (1,4, p);
/*????*/
p = X5; dis_one_zi (2,5, p);
p = X6; dis_one_zi (2,6, p);
p = X7; dis_one_zi (1,5, p);

X8 = p; dis_one_zi (1,6, p);
/ * 128X64 * /
p = X9; dis_one_zi (2,1, p);
X10 = p; dis_one_zi (2,2, p);
p = X11; dis_one_zi (2,3, p);
X23 = p; dis_one_zi (2,4, p);
LCD_C_D (1,0 X3F);
delay (); delay ();
CLRLCD (0);
LCD_C_D (1,0 x3e);
p = X12;
for (number = 0; numero <4; numero )
(
for (i = 0; i <8; i )
(Dis_one_zi (numero, i, p);)
)
LCD_C_D (1,0 X3F);
delay (); delay ();
CLRLCD (0);
LCD_C_D (1,0 x3e);
p = X13;
for (number = 0; numero <4; numero )
(
for (i = 0; i <8; i )
(Dis_one_zi (numero, i, p);)
)
LCD_C_D (1,0 X3F);
delay (); delay ();
CLRLCD (0);
)
)

 
> Può un corpo di convertire i seguenti codici per l'assemblaggio.

Certamente.Un compilatore C potrebbe.
Apperently, questo è destinato per 8051 ed è un frammento di Keil-specifici.È possibile utilizzare altri '51 come il compilatore SDCC, ma avresti bisogno di fare alcune modifiche (ad esempio, la porta spilli definizioni sono leggermente diverse - di leggere il manuale).

JW

 

Welcome to EDABoard.com

Sponsor

Back
Top