je

if equal then jmp

jg

if the second gt the first, then jmp

jge

if the second ge the first, then jmp

jl

if the second lt the first, then jmp

jle

if the second le the first, then jmp

AT&T 64-bit assembly

how to call library like printf?

The code shows the AT&T assembly on 64-bit Linux.

We use syscall instead of int 0x80.

We save parameters in registers before calling printf, instead of pushing the parameters on the stack.

This is the key:

How to debug assembly program on Linux ?

using gdb

as xx.s -gstabs -o xx.o      -gstabs is necessary,otherwise

commands:

run, next, info registers, break num(line number), quit

how to exit program rightly:

movq 1,%rax

int $0x80

AT&T Assembly on Linux的更多相关文章

  1. Linux C中内联汇编的语法格式及使用方法(Inline Assembly in Linux C)【转】

    转自:http://www.linuxidc.com/Linux/2013-06/85221p3.htm 阅读Linux内核源码或对代码做性能优化时,经常会有在C语言中嵌入一段汇编代码的需求,这种嵌入 ...

  2. AT&T ASSEMBLY FOR LINUX AND MAC (SYS_FORK)

    Fork() in C: (sys_fork.c) #include <stdio.h> #include <stdlib.h> #include <unistd.h&g ...

  3. AT&T Assembly for Linux and Mac (sys_write)

    Write() in C : (sys_write.c) #include <stdio.h> int main(void) { printf("Hello Landpack\n ...

  4. AT&T Assembly for Linux and Mac (sys_exit)

    Exit() in C : (sys_exit.c) int main(void) { ; } Exit() in AT&T for Linux: (sys_exit.s) .section ...

  5. 【Linux学习笔记】Linux C中内联汇编的语法格式及使用方法(Inline Assembly in Linux C)

    http://blog.csdn.net/slvher/article/details/8864996 https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm. ...

  6. An Assembly Language

    BUFFER OVERFLOW 3 An Assembly Language Introduction Basic of x86 Architecture Assembly Language Comp ...

  7. Linux 驱动开发

    linux驱动开发总结(一) 基础性总结 1, linux驱动一般分为3大类: * 字符设备 * 块设备 * 网络设备 2, 开发环境构建: * 交叉工具链构建 * NFS和tftp服务器安装 3, ...

  8. intel汇编笔记

    另一篇汇编学习笔记AT&T Assembly on Linux  (linux下) mov ax,bx     bx到ax 读数据过程:cpu通过地址线发送地址a,控制线向存储器发送读命令,存 ...

  9. Linux+Mono+WebService:CS1703: An assembly with the same identity--mscorlib

    最近把一些东西开始往Linux迁移了,因为老系统大部分都是.NET,所以直接使用Mono,代码一般都使用MonoDevelop把代码重新编译,把一些WMI和windows DLL调用改Linux的os ...

随机推荐

  1. java单例模式实现方式

    Singleton 模式要求一个类有且仅有一个实例,并提供一个全局访问点. Singleton模式 是一种职责型模式.因为我们创建了一个对象,这个对象扮演了独一无二的角色,在这个单独的对象实例中,它集 ...

  2. webform 之LINQde 简单操作

    LinQ: LinQ to Sql类它是一个集成化的数据访问类,微软将原本需要我们自己动手去编写的一些代码,集成到了这个类中,会自动生成. 数据库数据访问,能大大减少代码量. 那就是代码量减少 EF框 ...

  3. [fortify] 不安全的函数eregi()

    PHP 5.4/5.3弃用函数eregi() memory_limit绕过漏洞 [日期:2012-04-02] 来源:Linux社区  作者:Linux [字体:大 中 小]   发布日期:2012- ...

  4. java获取文件名的三种方法

    import java.io.File; import java.util.Arrays; public class FileName { /** * @param args */ public st ...

  5. C# 部分语法总结(入门经典)

    class Program { static void Main(string[] args) { init(); System.Console.ReadKey(); } #region 接口 /// ...

  6. PHPstudy 无法启动Apache

    今天打安装完phpstudy的时候,启动Apache发现端口被占用,这个端口也就是system端口.如果想要启动服务器必须关掉这个,但是会导致系统无法正常显示. 后来我就在网上搜各种办法,依然没成功. ...

  7. 无状态的web应用

    无意间看到这个话题,随便看了下 觉得有点意思.比较零散,记录一下. 1. http协议无状态. 简单的理解:每一个http请求都是独立的.不会因为前一个请求的失败就影响到下一个请求.既不会影响前面的, ...

  8. java.util.zip.ZipException: invalid entry size 解决办法

    启动maven项目时报java.util.zip.ZipException: invalid entry size (expected 7612 but got 5955 bytes) 可能是mave ...

  9. ubuntu安装octave的小坑

    出现了以下情况: After this operation, 163 MB of additional disk space will be used.Do you want to continue? ...

  10. 在mac下svn冲突或其它什么原因无法更新svn副本或是必须要删除svn信息时,如何清除svn信息

    find . -type d -name ".svn"|xargs rm -rf 出处: http://blog.csdn.net/springsky_/article/detai ...