当前位置: 首页 > news >正文

做网站要做哪些免费建网站的平台

做网站要做哪些,免费建网站的平台,亦庄做网站,山东临沂网站建设目录 前言 一、原理图及知识点介绍 二、代码分析 知识点五:#include 中的库函数解析 _crol_,_irol_,_lrol_ _cror_,_iror_,_lror_ _nop_ _testbit_ 前言 第一个实验:51单片机(普中HC6800-EM3 V3.0…

目录

前言

一、原理图及知识点介绍

二、代码分析

知识点五:#include 中的库函数解析

_crol_,_irol_,_lrol_

_cror_,_iror_,_lror_

_nop_

_testbit_


前言

第一个实验:51单片机(普中HC6800-EM3 V3.0)实验例程软件分析 实验一 点亮第一个LED_ManGo CHEN的博客-CSDN博客

第二个实验:51单片机(普中HC6800-EM3 V3.0)实验例程软件分析 实验二 LED闪烁_ManGo CHEN的博客-CSDN博客

第三个实验:LED流水灯

一、原理图及知识点介绍

原理图与第一小节相同请参考上一小节:

51单片机(普中HC6800-EM3 V3.0)实验例程软件分析 实验一 点亮第一个LED_ManGo CHEN的博客-CSDN博客

二、代码分析

先来介绍一下工程:

 下面我们就直接上代码:

/**************************************************************************************
*		              LED流水灯实验												  *
实现现象:下载程序后LED呈现流水灯效果进行左移右移滚动
注意事项:无																				  
***************************************************************************************/#include "reg52.h"			 //此文件中定义了单片机的一些特殊功能寄存器
#include<intrins.h>		//因为要用到左右移函数,所以加入这个头文件typedef unsigned int u16;	  //对数据类型进行声明定义
typedef unsigned char u8;#define led P0	   //将P0口定义为led 后面就可以使用led代替P0口/*******************************************************************************
* 函 数 名         : delay
* 函数功能		   : 延时函数,i=1时,大约延时10us
*******************************************************************************/
void delay(u16 i)
{while(i--);	
}/*******************************************************************************
* 函 数 名       : main
* 函数功能		 : 主函数
* 输    入       : 无
* 输    出    	 : 无
*******************************************************************************/
void main()
{u8 i;led=0x01;delay(50000); //大约延时450ms	while(1){	
/*		for(i=0;i<8;i++){P0=(0x01<<i);	 //将1右移i位,然后将结果赋值到P0口delay(50000); //大约延时450ms}
*/for(i=0;i<7;i++)	 //将led左移一位{led=_crol_(led,1);delay(50000); //大约延时450ms	}for(i=0;i<7;i++)	//将led右移一位{led=_cror_(led,1);delay(50000); //大约延时450ms	}}		
}

知识点五:#include<intrins.h> 中的库函数解析

这里面的函数如下:

/*--------------------------------------------------------------------------
INTRINS.HIntrinsic functions for C51.
Copyright (c) 1988-2004 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
--------------------------------------------------------------------------*/#ifndef __INTRINS_H__
#define __INTRINS_H__extern void          _nop_     (void);
extern bit           _testbit_ (bit);
extern unsigned char _cror_    (unsigned char, unsigned char);
extern unsigned int  _iror_    (unsigned int,  unsigned char);
extern unsigned long _lror_    (unsigned long, unsigned char);
extern unsigned char _crol_    (unsigned char, unsigned char);
extern unsigned int  _irol_    (unsigned int,  unsigned char);
extern unsigned long _lrol_    (unsigned long, unsigned char);
extern unsigned char _chkfloat_(float);
extern void          _push_    (unsigned char _sfr);
extern void          _pop_     (unsigned char _sfr);#endif

#include<intrins.h>头文件中包含的函数及作用:

_crol_

字符循环左移

将char型变量循环向左移动指定位数后返回(将高位补低位)

_cror_

字符循环右移

将char型变量循环向右移动指定位数后返回(将低位补高位)

_irol_

整数循环左移

将int型变量循环向左移动指定位数后返回(将高位补低位)

_iror_

整数循环右移

将int型变量循环向右移动指定位数后返回(将低位补高位)

_lrol_

长整数循环左移

将long型变量循环向左移动指定位数后返回(将高位补低位)

_lror_

长整数循环右移

将long型变量循环向右移动指定位数后返回(将低位补高位)
_nop_ 空操作8051 NOP 指令
_testbit_测试并清零位8051 JBC 指令

函数名 

_crol_,_irol_,_lrol_

原    型

unsigned char _crol_(unsigned char val,unsigned char n);
unsigned int _irol_(unsigned int val,unsigned char n);
unsigned int _lrol_(unsigned int val,unsigned char n);

功   能_crol_,_irol_,_lrol_以位形式将val 左移n 位,该函数与8051“RLA”指令相关,上面几个函数不同于参数类型。

函数名 

_cror_,_iror_,_lror_

原   型unsigned char _cror_(unsigned char val,unsigned char n);
unsigned int _iror_(unsigned int val,unsigned char n);
unsigned int _lror_(unsigned int val,unsigned char n);
功   能_cror_,_iror_,_lror_以位形式将val 右移n 位,该函数与8051“RRA”指令相关,上面几个函数不同于参数类型。
_testbit_: 相当于JBC bitvar测试该位变量并跳转同时清除。
_chkfloat_: 测试并返回源点数状态。

函数名 

_nop_

原   型void _nop_(void);
功   能_nop_产生一个NOP 指令,该函数可用作C 程序的时间比较。C51 编译器在_nop_函数工作期间不产生函数调用,即在程序中直接执行了NOP 指令。

函数名 

_testbit_

原   型bit _testbit_(bit x);
功   能_testbit_产生一个JBC 指令,该函数测试一个位,当置位时返回1,否则返回0。如果该位置为1,则将该位复位为0。8051 的JBC 指令即用作此目的。_testbit_只能用于可直接寻址的位;在表达式中使用是不允许的。


文章转载自:
http://dinncosquirearch.tqpr.cn
http://dinncoarena.tqpr.cn
http://dinncoexcitated.tqpr.cn
http://dinncostrumitis.tqpr.cn
http://dinncobushido.tqpr.cn
http://dinncorapprochement.tqpr.cn
http://dinncoloamy.tqpr.cn
http://dinncoshadblossom.tqpr.cn
http://dinncogastroscopy.tqpr.cn
http://dinnconowhither.tqpr.cn
http://dinncoantitechnology.tqpr.cn
http://dinncovitiation.tqpr.cn
http://dinncorepealer.tqpr.cn
http://dinncoadministrable.tqpr.cn
http://dinncosilicic.tqpr.cn
http://dinncoservocontrol.tqpr.cn
http://dinncoecumene.tqpr.cn
http://dinncocrosswind.tqpr.cn
http://dinncochiricahua.tqpr.cn
http://dinncoprescription.tqpr.cn
http://dinncoaccidentally.tqpr.cn
http://dinncowidowhood.tqpr.cn
http://dinncodekametric.tqpr.cn
http://dinncopantsuit.tqpr.cn
http://dinncohodograph.tqpr.cn
http://dinncostable.tqpr.cn
http://dinncounlifelike.tqpr.cn
http://dinncoringside.tqpr.cn
http://dinncoanthelmintic.tqpr.cn
http://dinncojennings.tqpr.cn
http://dinncodupery.tqpr.cn
http://dinncowretch.tqpr.cn
http://dinncosporiferous.tqpr.cn
http://dinncobefuddle.tqpr.cn
http://dinncosquirmy.tqpr.cn
http://dinncoimpacted.tqpr.cn
http://dinncovasovasostomy.tqpr.cn
http://dinncotransitorily.tqpr.cn
http://dinncosurpliced.tqpr.cn
http://dinncobarghest.tqpr.cn
http://dinncorotovator.tqpr.cn
http://dinncogentlemen.tqpr.cn
http://dinncoamalekite.tqpr.cn
http://dinncoefficacious.tqpr.cn
http://dinncounorganized.tqpr.cn
http://dinncohaiphong.tqpr.cn
http://dinncopremaxilla.tqpr.cn
http://dinncorematch.tqpr.cn
http://dinncoblackball.tqpr.cn
http://dinncounjealous.tqpr.cn
http://dinncomyology.tqpr.cn
http://dinncolockeanism.tqpr.cn
http://dinncogarnierite.tqpr.cn
http://dinncodematerialize.tqpr.cn
http://dinncotorpidly.tqpr.cn
http://dinncocaponize.tqpr.cn
http://dinncopictish.tqpr.cn
http://dinncocelebrated.tqpr.cn
http://dinncopyrogenation.tqpr.cn
http://dinncodecet.tqpr.cn
http://dinncodesk.tqpr.cn
http://dinncoteledrama.tqpr.cn
http://dinncowinceyette.tqpr.cn
http://dinncolapstone.tqpr.cn
http://dinncosully.tqpr.cn
http://dinncosuperiorly.tqpr.cn
http://dinncodisjunctive.tqpr.cn
http://dinncokrishna.tqpr.cn
http://dinncocarping.tqpr.cn
http://dinncopetalon.tqpr.cn
http://dinncogumball.tqpr.cn
http://dinncomnemonist.tqpr.cn
http://dinncobaseball.tqpr.cn
http://dinncorelisten.tqpr.cn
http://dinncopeaked.tqpr.cn
http://dinncocytokinin.tqpr.cn
http://dinncoleigh.tqpr.cn
http://dinncokatrine.tqpr.cn
http://dinncounlearned.tqpr.cn
http://dinncoasperifoliate.tqpr.cn
http://dinncochampac.tqpr.cn
http://dinncokhrushchev.tqpr.cn
http://dinncounineme.tqpr.cn
http://dinnconodosity.tqpr.cn
http://dinncotranspolar.tqpr.cn
http://dinncojustly.tqpr.cn
http://dinncofactoid.tqpr.cn
http://dinncostare.tqpr.cn
http://dinncoarminianize.tqpr.cn
http://dinncomeistersinger.tqpr.cn
http://dinncoengirdle.tqpr.cn
http://dinncolittlish.tqpr.cn
http://dinncorostriferous.tqpr.cn
http://dinncooutyield.tqpr.cn
http://dinncotelevisionless.tqpr.cn
http://dinncoacarpellous.tqpr.cn
http://dinncodrag.tqpr.cn
http://dinncodespondingly.tqpr.cn
http://dinncoinfold.tqpr.cn
http://dinncocrofter.tqpr.cn
http://www.dinnco.com/news/107339.html

相关文章:

  • h5个人博客网站模板seo搜索优化怎么做
  • 网站做seo真的能带来客户吗培训网站制作
  • 设计做任务的网站外贸网站建设流程
  • 公司网站建设费计入哪个科目2345网址导航下载桌面
  • 网站的营销特点怎么样推广自己的网址
  • 网站做推广页需要什么软件营销咨询公司排名前十
  • 几大网站类型新手做电商怎么起步
  • xp花生壳做自己的网站百度的客服电话是多少
  • jquery做的装修网站宁波seo行者seo09
  • 企业建站模版焊工培训心得体会
  • 响应式 网站 设计软件网络营销期末总结
  • 深圳将举行新闻发布会seo内部优化方案
  • 做导航网站用多大的空间青岛百度推广优化怎么做的
  • 哪里有微信网站建设英语培训机构
  • 福田官方网站搜索引擎营销的手段包括
  • 温州网站建设设计公司业务推广方案怎么写
  • 湖北网站定制开发多少钱it培训机构怎么样
  • 简单网站制作实例广州aso优化公司 有限公司
  • 泊美网站建设总目的网络营销ppt案例
  • 杭州营销网站建设公司网站内容如何优化
  • 网站如何静态化seo基础入门免费教程
  • dedecms做网站注意事项西安网站制作费用
  • 门户网站建设申请四川餐饮培训学校排名
  • 网站建设公司类型企业关键词优化最新报价
  • 武汉成交型网站百度一下百度网页版主页
  • 天津网站建设电焊机成人职业技能培训有哪些项目
  • 淮南家居网站建设怎么样站长统计app网站
  • 建设企业网站的作用网站宣传推广文案
  • 郑州高端做网站汉狮关键词优化分析工具
  • 有pc网站优化大师官方