Notes
- Sorry, somewhat brief notes.
- x /3g address
-
struct NodeT { long count {0}; char * word {nullptr}; NodeT * next {nullptr}; } - The code is from listLib.asm
- This takes some planning so:
COUNT_OFFSET equ 0 WORD_OFFSET equ 8 NEXT_OFFSET equ 16 RECORD_SIZE equ 24 ... NEW_NODE: ; rdi holds the string address ... mov r12, rdi mov rdi, RECORD_SIZE call malloc mov qword [rax + COUNT_OFFSET] , 1 mov qword [rax + WORD_OFFSET] , r12 mov qword [rax + NEXT_OFFSET] , 0 ...- Continue to build functions:
- INSERT_NODE
- This is really a stub, we might build a better one in class.
-
INSERT_NODE: ; rdi will hold the head of the list ; rsi will hold the new node ; rax will return the new node mov rax, rsi mov [rsi + NEXT_OFFSET], rdi ret
- Look at PRINT_LIST, nothing relly special
- Look at DELETE_LIST, again nothing special
- main.asm just calls the functions.