初学AT&T汇编,刚学会如何编译
发表于 : 2007-11-21 21:26
[liuweni@Liuweni asm]$ cat hw
#This is my first assembly language
.section .data
output:
.ascii "The processor Vendor ID is ‘xxxxxxxxxxxx’\n"
.section .text
.globl _start
_start:
movl $0, %eax
cpuid
movl $output, %edi
movl %ebx, 28(%edi)
movl %edx, 32(%edi)
movl %ecx, 36(%edi)
movl $4, %eax
movl $1, %ebx
movl $output, %ecx
movl $42, %edx
int $0x80
movl $1, %eax
movl $0, %ebx
int $0x80
[liuweni@Liuweni asm]$ as hw
[liuweni@Liuweni asm]$ ls
a.out hw hw.bak hw.o
[liuweni@Liuweni asm]$ ./a.out
bash: ./a.out: 权限不够
[liuweni@Liuweni asm]$ su
口令:
[root@Liuweni asm]# ./a.out
bash: ./a.out: 权限不够
[root@Liuweni asm]#
#This is my first assembly language
.section .data
output:
.ascii "The processor Vendor ID is ‘xxxxxxxxxxxx’\n"
.section .text
.globl _start
_start:
movl $0, %eax
cpuid
movl $output, %edi
movl %ebx, 28(%edi)
movl %edx, 32(%edi)
movl %ecx, 36(%edi)
movl $4, %eax
movl $1, %ebx
movl $output, %ecx
movl $42, %edx
int $0x80
movl $1, %eax
movl $0, %ebx
int $0x80
[liuweni@Liuweni asm]$ as hw
[liuweni@Liuweni asm]$ ls
a.out hw hw.bak hw.o
[liuweni@Liuweni asm]$ ./a.out
bash: ./a.out: 权限不够
[liuweni@Liuweni asm]$ su
口令:
[root@Liuweni asm]# ./a.out
bash: ./a.out: 权限不够
[root@Liuweni asm]#