C a Assembléia Conversão

I

Ibrar

Guest
oi tudo

algum corpo pode converter seguintes códigos na montagem.Estes códigos são para jhd12864 GLCD.

Obrigado

# 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;
L_CS2 sbit = P2 ^ 7;
sbit L_SET = P2 ^ 3;
sbit TEST = P3 ^ 5;
float abc;
X1 código 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 código 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 código 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 código 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
); /*?*/
uchar X5
Code:
 = (
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 código 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 código 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 Código 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
); /*?*/
uchar X9 [code] = (
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 código 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 código 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 código 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 código 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 código 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 código 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 código 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 código 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 código 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 código 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 código 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 código 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 código 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 código 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)
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;
)
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 (sinalizador de bit, ldata uchar) / * flag = bandeira 1 con = 0 dados * /
(
uchar i de dados;
L_DI = flag!; L_E = 0; P0 L_RW = 0; = 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 código, y_add 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 (número uchar)
(
uchar dados 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, número);
)
L_CS1 = L_CS2 = 0;
)
void main (void) utilizando 0
(
uchar dados de número i, j,;
Código uchar * 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 (numero = 1; número <7; número )
(Dis_one_zi (0, número, p);)
p = X16;
for (numero = 1; número <7; número )
(Dis_one_zi (3, número, p);)
X17 = p;
for (numero = 1; número <3; número )
(Dis_one_zi (número, 0, p);)
X18 = p;
for (numero = 1; número <3; número )
(Dis_one_zi (número, 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);
X12 = p;
for (numero = 0; número <4; número )
(
for (i = 0; i <8; i )
(Dis_one_zi (número, i, p);)
)
LCD_C_D (1,0 X3F);
delay (); delay ();
CLRLCD (0);
LCD_C_D (1,0 x3E);
X13 = p;
for (numero = 0; número <4; número )
(
for (i = 0; i <8; i )
(Dis_one_zi (número, i, p);)
)
LCD_C_D (1,0 X3F);
delay (); delay ();
CLRLCD (0);
)
)
 
> Algum corpo pode converter seguintes códigos na montagem.

É claro.A C-compilador poderia.
Apperently, este destina-se a 8051 e é um Keil-trecho específico.Você pode usar o compilador de '51, como SDCC, mas você precisa fazer algumas modificações (por exemplo, a porta de pinos definições são um pouco diferente - leia o manual).

JW

 

Welcome to EDABoard.com

Sponsor

Back
Top