Doubly Linked List in Assembly Language

venom555

Power Member
Joined
Apr 21, 2012
Messages
545
Reaction score
20
Can someone let me know how to create a program for doubly linked list in assembly language (.asm)
Because I really dont know, thanks and waiting.
 
Last edited:
You have to provide more details if you want someone to help. What platform? What is the data type of the list?

If this is your first time working with linked lists I would start in C as the memory can be a brain fuzzer, and dereferencing NULL is a non-starter.
 
I think is better a code double link in C and use GCC to generate Assembly without optimizations. After that study assembly result to make more human coded.
 
code it in c and compile it using cc programname.c -s and open programname.s then it will generate the assembly code for the program (unix system)
 
you need to find in google ..if you need ebook regarding this then find in download section
 
Why would you do that in assembly language? why punish yourself like that.

It really depends on the architecture of the processor you are deploying it on, are you using MIPS or X86?
is your processor big endian or little endian?

I agree with JP1016 compile C++ code to assembly language from the command line and see what the compiler does

then make your optimizations after the code is compiled.
 
I haven't used assembly in a while, but in MASM a linked list struct would look something like this (assuming 32-bit):
Code:
link STRUCT
    prev DWORD 0   ; pointer to previous link
    next DWORD 0   ; pointer to next link
    ; whatever data you need to store here
link END

Then, to use the structure, you'd need to allocate memory from the heap in whatever way is most convenient, and set the "prev" and "next" pointers to the addresses of the respective link structs in the list.
 
linked lists in C is much easier to implement than Assemby..Don't get the reason to use Assembly
 
I'm sensing Homework Assitance Thread here... Otherwise why the hell would you hand write a doubly linked list in assembly!!!
 
I've seen it used for memory managers on embedded targets before.
 
Back
Top