Z88 Developers' Notes
Contents   Contents of System Calls

GN_Xdl, delete an entry from a linked list

RST 20H, DEFW $4809

IN:

     CDE = pointer to previous entry
     BHL = pointer to entry to delete
OUT, if call successful:
     Fc = 0
     CDE = pointer to prior entry
     BHL = entry after deleted entry
OUT, if call failed:
     Fc = 1
     A = error code:
          RC_BAD ($04), if BHL(in) = 0
Registers changed after return:
     ...CDE../IXIY same
     AFB...HL/.... different
Notes:
Algorithm: Assuming deleting entry I between entries X and Y:
*X = *X XOR I XOR Y
*Y = *Y XOR I XOR X
Bugs:
 

Related calls:

GN_Xin, insert an entry into a linked list
GN_Xnx, index next entry in linked list