C 汇编混合编程
As is Known to us,the function Main is the entry point of all programs.Therefore, we are usually neglecting all that we don't do,which makes us not understanding it more clearly.Now there is a sample arm program which will provide something that opration system usually do.
asm:
IMPORT main
area test,CODE,READONLY
ENTRY
bl start
start
bl main
C:
#define rGPBCON (*(volatile unsigned *)0x56000010) //Port B control
#define rGPBDAT (*(volatile unsigned *)0x56000014) //Port B data
#define rGPBUP (*(volatile unsigned *)0x56000018) //Pull-up control B
int main(int argc, char *argv[])
{
unsigned int temp = 0x0e;
rGPBCON = 0x00555555;
rGPBUP = 0xffff;
rGPBDAT = 0XE1F;
return 0;
}
The code very sample,but it is very useful.
相关文档:
typedef struct StackNode
{
ElemType data;
StackNode *next;
)StackNode, *LinkType; &nb ......
1//由于使用gcc编译,所以编译时要链接上c++的库,命令是gcc -lstdc++ main.cpp -o main
//本文小程序实现的是对/home/1.avi大小的计算。很简单,贴出来只是为了方便不知道的朋友
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <sys/stat.h>
5 #includ ......
CentOs5安装apache的时候
#./configure
(于检查系统是否有编译时所需的库,以及库的版本是否满足编译的需要等安装所需要的系统信息。为随后的编译工作做准备。)
提示错误如下:(没有GCC编译器环境)
checking build system type... i686-pc-linux-gnu
checking host system type.. ......
1、C/C++程序员请注意,不能在case语句不为空时“向下执行”。
2、值类型和引用类型之间的区别:C#的基本类型(int,char等)都是值类型,是在栈中创建的。而对象是引用类型,创建于堆中,需要使用关键字new。
3、在C#中通过实例访问静态方法或成员变量是不合法的,会生成编译器错误。但是我们可以 ......
网上有好多篇文章讲如何配置.vimrc文件来实现VIM里一键编译,看了一下比较复杂。我一般没有什么大的程序要写,一般的小程序单个C文件就搞掂了,所以简化了一下网上的配置,在.vimrc里加上两行就满足我的需求了。
set makeprg=gcc\ -Wall\ -o\ %<\ %
map <F7> :make<CR ......