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. CS0234: 命名空间“System.Web.Mvc”中不存在类型或命名空间名称“Html、Ajax”(是否缺少程序集引用?)

    从SVN上down下来的程序,编译报了一大堆的错,发现是缺少引用,但是明明引用了,后来打开引用,发现system.web.mvc这个引用打着叹号,如图: 后来重新引用了本机的system.web.mv ...

  2. 微信小程序 设计理念指南

    在此处输入标题   微信小程序的几条开发建议 功能简约,场景贴近随用随走: 操作快捷方便,交互简单: 程序本身代码资源等文件大小限制在1MB之内,这是微信目前的硬限制,目的是为了使得最终到达用户设备上 ...

  3. Python小练习二

    # 以正确的宽度在居中的"盒子"内打印一个句子 # 注意,整数除法运算符(//)只能用在Python 2.2及后续版本,在之前的版本中,只使用普通除法(/) sentence = ...

  4. IAR FOR ARM的安装及破解

    本博文主要是介绍如何安装以及破解IAR FOR ARM . 1.下载IAR FOR ARM以及注册机 IAR FOR ARM下载:http://pan.baidu.com/s/1i5t1qF7 注册机 ...

  5. Java 第17章 继承

    继承的概念 继承机制是面向对象程序设计不可缺少的关键概念,是实现软件可重用的根基, 是提高软件系统的可扩展性与可维护性的主要途径. 所谓继承是指一个类的定义可以基于另外一个已经存在的类,即子类基于父类 ...

  6. 使用html2canvas实现网页截图并嵌入到PDF

    以前我们只能通过截图工具进行截取图像.这使得在业务生产中,变得越来越不方便.目前的浏览器功能越来越强大,H5也逐渐普及,浏览器也可以实现截图了.这里来聊下之前在工作中用到的html2canvas.这里 ...

  7. Linux netstat命令详解

    Linux netstat命令详解 一  简介 Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多 ...

  8. XPath使用示例

    1.查找空节点//*[not(text())]        表示内容为空的节点//*[count(*)=0]         表示没有子节点的节点"//*[count(*)=0 and n ...

  9. maven pox配置

    Maven教程初级篇02:pom.xml配置初步 1. 创建项目并更改项目基本配置信息 在命令行下运行如下命令创建一个项目: 1 mvn archetype:create -DgroupId=net. ...

  10. 一种简单的实现:Android一键换肤功能

    现在的APP开发,通常会提供APP的换肤功能,网上流传的换肤代码和实现手段过于复杂,我把原作者的代码重新整理抽取出来,转换成Eclipse项目,重新整理成正确.可直接运行的项目. 代码运行结果如图. ...