AT&T Assembly on Linux

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

posted on 2016-09-24 22:18  J·Marcus  阅读(359)  评论(0编辑  收藏  举报

导航