[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Following Assembly Language Step-by-Step using emacs

From: Robert Webb Jr
Subject: Following Assembly Language Step-by-Step using emacs
Date: Sat, 6 Jul 2013 16:08:26 -0700

Thanks for taking the time to look at my question.
I am new to linux and new to programming.
The text I am learning assembly (and introductory programming) from uses
kdb and insight.
I am using Ubuntu 12.04 LTS. kdb was not working right and Insight is
extinct. So after a great deal of tail-chasing I discovered
After another round of chasing tail, I got emacs into many-windows mode so
that I can follow along with the text.
Except for one little thing.
The text says that when debugging with kdb, there should be an arrow in the
fringe area of the source code that indicates which line is about to be
>From what I've read, I think emacs should do this too - but all I can get
is the hex memory address of the line being executed (I think) in the gud
buffer (upper left-hand window).
So basically, I don't know exactly where I'm at in the source code when I'm
stepping through the instructions.
Am I supposed to just count the hex addresses in the gud buffer and keep
track that way?
Seems not too smart.
Here is the program that I'm debugging:

;  Executable name : EATSYSCALL
;  Version         : 1.0
;  Created date    : 1/7/2009
;  Last update     : 2/18/2009
;  Author          : Jeff Duntemann
;  Description     : A simple program in assembly for Linux, using NASM
;    demonstrating the use of Linux INT 80H syscalls to display text.
;  Build using these commands:
;    nasm -f elf -g -F stabs eatsyscall.asm
;    ld -o eatsyscall eatsyscall.o

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!

    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

I would greatly appreciate any help; I sure it's something simple, but it
might as well be rocket science to me at this point.
Have a nice day.

The Great Secret?
"It is, and It isn't".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]