Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
; x86_64 Linux NASM
|
||||
; Linked_List_Insert.asm
|
||||
|
||||
%ifndef INSERT
|
||||
%define INSERT
|
||||
|
||||
%include "Linked_List_Definition.asm" ; see LL def task
|
||||
%include "Heap_Alloc.asm" ; see memory allocation task
|
||||
|
||||
section .text
|
||||
|
||||
; rdi - link to insert after
|
||||
; rsi - value that the new link will hold
|
||||
Insert_After:
|
||||
push rdi
|
||||
push rsi
|
||||
mov rdi, linkSize
|
||||
call alloc
|
||||
cmp rax, 0
|
||||
je Memory_Allocation_Failure_Exception
|
||||
pop rdi
|
||||
mov dword [rax + value], edi
|
||||
pop rdi
|
||||
mov rsi, qword [rdi + next]
|
||||
mov qword [rax + next], rsi
|
||||
mov qword [rdi + next], rax
|
||||
ret
|
||||
|
||||
%endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue