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. idea 从github下载项目提示 file name too long 的解决方案

    1.找到git shell命令行 2运行如下命令 git config --global core.longpaths true 附地址https://github.com/Strider-CD/st ...

  2. zabbix3.0 微信告警

    首先需要申请一个企业号,其实公众号也可以,不过脚本不一样.而且公众号任何人都可以关注,有泄密的风险.企业号只有指定的人可以关注,安全性较高.申请企业号,需要一个绑定你本人开户银行卡的微信号. 申请网址 ...

  3. Java实现Excel导入数据库,数据库中的数据导入到Excel

    private static void executeMethod(JobExecutionContext arg0) throws Exception{ try { TContrastService ...

  4. jackson json转list

    今天项目中用到了jackson,经理说效率高一些,所以就开始用起来,一开始json转对象,对象转json还是很简单的,但也还是有一些问题,后来加了一点配置属性就没有报错了 ObjectMapper m ...

  5. 【计算几何】bzoj1043 [HAOI2008]下落的圆盘

    n^2枚举圆盘,用两圆圆心的向量的极角+余弦定理求某个圆覆盖了该圆的哪一段区间(用弧度表示),最后求个区间并. 注意--精度--最好再累计区间的时候,把每个区间的长度减去EPS,防止最后覆盖的总区间超 ...

  6. 自动挂载文件/etc/fstab功能详解

    今天看了这篇文章,对于自动挂载中的一些小细节和参数有了更深的理解,所以这次把它摘下来,留做查询 一./etc/fstab文件的作用 1.我们把磁盘手动挂载之后如果不把它写入/etc/fstab这个文件 ...

  7. visual studio 2005 常用按键

    VS2005 实用快捷键,迅速提高代码编写效率! 代码快捷键   Ctrl+J / Ctrl+K,L   列出成员   Ctrl+Shift+空格键 / Ctrl+K,P   参数信息   Ctrl+ ...

  8. 1014 : Trie树 hihocoder

    时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进. ...

  9. 42. Trapping Rain Water

    Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...

  10. 转载扩展Windows Mobile模拟器存储空间的方法

    扩展Windows Mobile模拟器存储空间的方法 在Windows Mobile应用程序开发的初期,可以使用SDK自带的模拟器来进行调试,这给我们开发人员提供了一种方便的途径.一般的应用程序,占用 ...