【发布时间】:2014-12-31 09:59:25
【问题描述】:
我正在学习 Jeff Duntemann 的书:Step by Step Assembly。以下是提供的源代码:
SECTION .data ; Section containing initialised data
EatMsg: db "Eat at Joe's!",10
EatLen: equ $-EatMsg
SECTION .bss ; Section containing uninitialized data
SECTION .text ; Section containing code
global _start ; Linker needs this to find the entry point!
_start:
nop ; This no-op keeps gdb happy...
mov eax,4 ; Specify sys_write call
mov ebx,1 ; Specify File Descriptor 1: Standard Output
mov ecx,EatMsg ; Pass offset of the message
mov edx,EatLen ; Pass the length of the message
int 80H ; Make kernel call
MOV eax,1 ; Code for Exit Syscall
mov ebx,0 ; Return a code of zero
int 80H ; Make kernel call
我在 64 位 MacOS Yosemite 之上的 VirtualBoxVM 上运行 Ubuntu 12.04 32 位。
我在打电话:
kdbg eatsyscall
启动 KDBG。
在 watches 部分我有 2 个表达式:EatMsg 和 EatLen
当我使用 KDBG 为 EatMsg 运行代码时,我看到:544497989,但对于 EatLen,我看到:Cannot Access Memory At 0xe
我有两个问题:
这个 544497989 的值是什么?为什么我看到 EatLen 的“无法访问”消息?
【问题讨论】: