_compressed_format_data_var_copy.s 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .xdef __handle_data_var_AND___compressed_format_data_var_AND___data_var_create_copy,__compressed_format_data_var_copy
  2. .section _st97
  3. __compressed_format_data_var_copy:
  4. | Put the data size on the stack for HeapAllocPtr.
  5. move.l #__ld_data_size,(%sp)
  6. | Call HeapAllocPtr.
  7. move.l (%a5,0xA2*4),%a0 /* HeapAllocPtr */
  8. jsr (%a0)
  9. | Put the return address for the "out of memory"
  10. | message on the stack.
  11. pea.l __compressed_format_data_var_cleanup_almost_end(%pc)
  12. | Put the result of HeapDeref into %d3.
  13. move.l %a0,%d3
  14. | If the result is 0, give an "out of memory" message.
  15. beq __out_of_memory
  16. addq.l #4,%sp
  17. | Put the file handle on the stack for HeapDeref.
  18. move.w %d4,(%sp)
  19. | Call HeapDeref.
  20. move.l (%a5,0x96*4),%a0 /* HeapDeref */
  21. jsr (%a0)
  22. | Put the size on the stack for memcpy (len parameter).
  23. move.l #__ld_data_size,(%sp)
  24. | Push the result on the stack for memcpy (src
  25. | parameter). Add 2 to skip the size bytes.
  26. pea.l 2(%a0)
  27. | Push the destination address on the stack for memcpy
  28. | (dest parameter).
  29. move.l %d3,-(%sp)
  30. | Call memcpy.
  31. move.l (%a5,0x26A*4),%a0 /* memcpy */
  32. jsr (%a0)
  33. | Clean up the stack.
  34. addq.l #8,%sp
  35. | Clear %d4 to meet the convention.
  36. moveq.l #0,%d4
  37. | Go to the relocation routine.
  38. bra.s __compressed_format_data_var_relocate
  39. .section _st1063
  40. | Instead of unlocking the file handle, free the copy.
  41. move.l %d3,(%sp)
  42. move.l (%a5,0xA3*4),%a0 /* HeapFreePtr */
  43. jsr (%a0)
  44. bra.s __compressed_format_data_var_cleanup_almost_end