The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MegaLZ depacker
#2
Nice :!:
I'll convert it to fastcall and will pack it with the compiler.

Update: I see you load DE from (IX+n) but not HL? Probably it's working because the compiler uses HL to load addresses and it's already set. But this could crash under some circumnstances. There should be a LD HL, (IX+n) sequence to load HL too.

But better convert it to fascall:
Code:
SUB FASTCALL megaLZDepack (source as uInteger, dest as uInteger) ASM ; HL already loaded (source) ; dest in the stack, before the return address pop bc ; Remove return address pop de ; DE <-- dest address ; NOTE: Remove LD D, (IX+n) and LD E, (IX+n) instructions push bc ; Restores return address ; The remaing code is untouched: ;Z80 depacker for megalz V4 packed files (C) fyrex^mhm ; DESCRIPTION: ; ; Depacker is fully relocatable, not self-modifying, ;it's length is 110 bytes starting from DEC40. ...
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)