代码改变世界

随笔分类 -  Linux

如何在Linux下写汇编

2013-05-02 15:23 by fingertouch, 6000 阅读, 收藏,
摘要: 本文为翻译文章,原文参见:http://docs.cs.up.ac.za/programming/asm/derick_tut/ 1.NASM编译器 目前Linux下的汇编器主要有:as、as86和gas,但是本文使用的是NASM(The Netwide Assembler)。它使用Intel形式的汇编格式,和Intel形式相对的是AT&T形式的汇编格式。 2.Linux下汇编介绍 2.1... 阅读全文

Linux下编译程序

2012-10-29 23:38 by fingertouch, 254 阅读, 收藏,
摘要: 一.编译C程序1.编译单个C程序:现编译如下程序(hello.c):#include<stdio.h>#include<stdlib.h>int main(int argc,char *argv[]){ printf("Hello Linux!"); return 0;} 使用:#gcc -o hello hello.c其中:-o选项是用来重命名程序名词,否则默认的程序名词为a.out2.编译多个源文件现同时编译两个文件(hello.h hello.c和main.c)://hello.h#ifndef __HELLO_H_#define __HELL 阅读全文