3
Contributors
9
Replies
10
Views
7 Years
Discussion Span
Last Post by user543820
0

but what is " size node" and "*" operator is perhaps not applicable in assembly

0

the problem is that i haven't studied structures in assembly
i am supposed to deal with linked lists

0

Before we go further, can you tell us which assembler you're working in? There are significant differences in how different assemblers handles structures.

Also, if you're working in linked lists, we'll also need to know the operating system, as you'll need to use the system calls for memory allocation and deleting.

This thread may help you understand how structures in assembly work, though it uses a specific assembler/emulator (SPIM, a MIPS emulator) for its examples; more advanced assemblers such as MASM and Netwide Assembler have built-in support for structures that is comparable to languages such as C.

Edited by Schol-R-LEA: n/a

0

the problem is that i haven't studied structures in assembly
i am supposed to deal with linked lists

Well you had better get to studying them because that's what linked lists use. In assembly language structures may be also called records.

0

OK, then. Assuming that we're talking about 16-bit code, a simple linked list node in MASM might look like this:

node STRUCT
    data WORD ?
    next WORD ?
node ENDS

Of course, the structure itself isn't the only important factor; it's how you use it that counts. The structure is more or less a template or pattern for a particular interpretation of a block of memory. In the case of a linked list, generally speaking this memory will be allocated at run time from the operating system.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.