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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.