将下面的汇编程序转换为C语言
发布网友
发布时间:2024-08-07 06:13
我来回答
共3个回答
热心网友
时间:2024-08-17 20:08
我写个,不过你说的外部RAM 我不知道你指的是哪个。所以我就么写,
#include<reg51.h>
#define uchar unsigned char
uchar *p;
uchar code table[]={0x21,0x23,0x25,0x26,0x27,0x28,0x29,0x22,0x31,0x33,0x35,0x36,0x37,0x38,0x39,0x32,0x50,0x51,0x52,0x53,0x55,0x56,0x57,0x58,0x69,0x98,0x85,0x76,0x92,0x83,0x65,0x66};
P2 = 0x40;
p=table;//指针p 指向表table 首地址。就相当于把表格整个赋值给P了,P 可以直接指向外部RAM;
热心网友
时间:2024-08-17 20:09
#include<reg51.h>
#include <absacc.h> /* Include Macro Definitions */
#define uchar unsigned char
#define ext_ram XBYTE[0x0000] //程序存储器中表的内容送入外部RAM单元
,外部RAM地址0000
uchar code TAB[]={0x21,0x23,0x25,0x26,0x27,0x28,0x29,0x22,0x31,0x33,0x35,0x36,0x37,0x38,0x39,0x32,0x50,0x51,0x52,0x53,0x55,0x56,0x57,0x58,0x69,0x98,0x85,0x76,0x92,0x83,0x65,0x66};
main()
{
uchar i;
for (i=0;i<33;i++)
ext_ram=TAB[i];
while(1);
}
热心网友
时间:2024-08-17 20:07
晕~~~汇编语言