帮忙把这段C代码翻译成汇编语言

来源:百度知道 编辑:UC知道 时间:2024/05/25 04:51:00
#include<reg51.h> //定义变量
#define uchar unsigned char
sbit spi_clk=P0^1;
sbit spi_data=P0^0;
sbit spi_cs=P0^2;
unsigned int amp=0x0ffc;
uchar flag=4;
unsigned int value;
uchar f;
int t1=10;
int t2=8;

main() //主程序
{IP=0x03; //中断优先级
EA=1; //开中断
EX1=1;
IT1=1;
TMOD=0x12; //确定定时方式
while(1) ;
{fudu();}}

uchar kbscan(void) // 键盘扫描函数
{ uchar i;
uchar scode,rcode;
P2=0xf0; //P2.0~P2.3发全0,P2.4~P2.7输入
if((P2&0xf0)!=0xf0) //如P2口高4位不全为1,有键按下
{for(i=0;i<200;i++) //延时去抖
if((P2&0xf0)!=0xf0)
{scode=0xfe; //置行扫描初值
while((scode&0x10)!=0) //不到最后一行循环
{P2=scode;
if((P2&0xf0)!=0xf0) //如P2.4~P2.7口高4位不全为1,该行有键按下
{rcode=(P2&0xf0);
scode=scode&0x0f;

用伟福的软件模拟器,编译通过后,在窗口的下拉菜单中,点CPU窗口就可以看到相应的汇编程序了

你尝试用OD反汇编一下试一试.

刚学汇编的路过!

先把程序编译成HEX文件,再进行反汇编。
这是可以办到的。