Singly-linked list/Element definition: Difference between revisions

(→‎{{header|Diego}}: Added Diego entry)
Line 98:
C
</pre>
 
=={{header|6502 Assembly}}==
A linked list entry can be created by writing its value and the pointer to the next one to RAM. It should be noted that without some form of dynamic memory allocation, a linked list is not easy to use.
 
<lang 6502asm>;create a node at address $0020, and another node at address $0040.
;The first node has a value of #$77, the second, #$99.
;create first node
LDA #$77
STA $20
LDA #$40
STA $21
LDA #$00
STA $22
 
;create second node
LDA #$99
STA $40
LDA #$FF ;use $FFFF as the null pointer since the only thing that can be at address $FFFF is the high byte of the IRQ routine.
STA $41
STA $42 </lang>
 
=={{header|AArch64 Assembly}}==
1,489

edits