Programing Group Up

来源:互联网 发布:战国之王刷金软件 编辑:程序博客网 时间:2024/05/01 00:49

 

I loveprogramming. I enjoy the challenge to not only make a working program, but to do so with style. Programming islike poetry. It conveys a message, not only to the computer, but to those who modify and use your program. Witha program, you build your ownworld with your own rules. You create your world according to your conception of both the problem andthe solution. Masterful programmers create worlds with programs that are clear and succinct, much like apoem or essay.

                                 referenced Programing Group Up, by Jonathan Bartlett

 

http://savannah.nongnu.org/projects/pgubook/

 

 

例如:

.section.data

hello:.string "hello masm/n"

.section.text

.globl _start

_start:

movl $4, %eax

movl $1, %ebx

movl $hello, %ecx # placed a dollar sign in front of my_buffer.

                                #the reason for this is that without the dollar sign,

                                #my_buffer is treated as a memory location, and is

                                #accessed in direct addressing mode.

                                #The dollar sign switches it to immediate mode addressing,

                                #which actually loads the number represented by my_buffer

                                #into %ecx. the number represented by my_buffer means

                                #the address of the start of my_buffer

#使用$hello是立即数寻址,得到的是hello代表的内粗地址

#使用hello是直接寻址,得到的是hello的内存地址中的数据,即'h'

 

movl $11, %edx

int $0x80

movl %eax, %ebx

movl $1, %eax

int $0x80

 

原创粉丝点击