at&t汇编

 一般分为三个部分

  .data     .bss    .text

 data是声明的值的变量,bss是声明存储空间的变量,而.text是代码区。

 以下是例子

section .data
	message:    db 'Hello world!'     ; Declare message to contain the bytes 'Hello world!' (without quotes)
	msglength:  equ 12                ; Declare msglength to have the constant value 12
	buffersize: dw 1024               ; Declare buffersize to be a word containing 1024

section .bss
	filename:   resb    255           ; Reserve 255 bytes
	number:     resb    1             ; Reserve 1 byte
	bignum:     resw    1             ; Reserve 1 word (1 word = 2 bytes)
	realarray:  resq    10            ; Reserve an array of 10 reals

section .text
	global _start

_start:
	pop    ebx        ; Here is the where the program actually begins
	.
	.
	.
posted @ 2014-05-17 21:07  ggaaooppeenngg  阅读(223)  评论(0编辑  收藏  举报