首页 新闻 会员 周边

AT&AT汇编在GDB中显示数据.

0
悬赏园豆:50 [已关闭问题] 关闭于 2014-05-14 20:25

2

        .section .data
data1:
        .int 315814
data2:
        .int 165432
result:
        .quad 0
output:
        .asciz "the result is %qd\n"
        .section .text
        .globl _start
_start:
        movl data1, %eax
        mull data2
        movl %eax, result
        movl %edx, result+4
        pushl %edx
        pushl %eax
        pushl $output
        call printf
        add $12, %esp
        pushl result
        pushl $output
        call printf
        add $12, %esp
        pushl $0
        call exit

版本: GNU gdb (GDB) Fedora 7.6.50.20130731-19.fc20

我在gdb中 x/8b &result   x/gd &values 的值总是0, 但是call printf就输出

 

 

section .data
values1:
.float 12.34
values2:
.double 2353.631

.section .bss
.lcomm data, 8

.section .text

.globl _start
_start:
flds values1
fldl values2
fstl data

movl $1, %eax
movl $0, %ebx
int $0x80
我在书中的这个代码执行的时候, 在gdb 中x 和display 都没有data 的值

## (gdb) x/4xb &values1
## 0x804a000: 0xa4 0x70 0x45 0x41
## (gdb) x/8xb &values2
## 0x804a004: 0x8d 0x97 0x6e 0x12 0x43 0x63 0xa2 0x40


## 用display 指令
## (gdb) display /f values1
## 4: /f values1 = 12.3400002
## (gdb) display /gf &values2 # 奇怪 dispay 的指令和上面的不一样的
## 3: x/fg &values2 0x804a004: 2353.6309999999999

 

用了display values1 和 values2 的情况是不一样这是为什么........

sunzhenxiang的主页 sunzhenxiang | 菜鸟二级 | 园豆:202
提问于:2014-05-11 16:59
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册