Advertisement
beckadam

macro relocate

Jul 10th, 2020
2,404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. macro relocate? name, address*
  2.     name.source? := $
  3.     name.destination? := address
  4.     org name.destination?
  5.     macro name.copy?
  6.         ld  hl, name.source?
  7.         ld  de, name.destination?
  8.         ld  bc, name.length?
  9.         ldir
  10.     end macro
  11.     macro name.run
  12.         name.copy
  13.         jp  name.destination?
  14.     end macro
  15.     macro name.call
  16.         name.copy
  17.         call    name.destination?
  18.     end macro
  19.     macro end?.relocate?
  20.         name.length? := $ - name.destination?
  21.         org name.source? + name.length?
  22.         purge end?.relocate?
  23.     end macro
  24. end macro
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement