Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Convert upstream assembly files to NASM syntax #166

Open
ghost opened this issue Dec 26, 2021 · 1 comment
Open

Idea: Convert upstream assembly files to NASM syntax #166

ghost opened this issue Dec 26, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 26, 2021

No description provided.

@pete4abw
Copy link

pete4abw commented Dec 27, 2021

It took a lot of work to convert the code. The @catstr macro is merely a string concatenation. But the references had no meaning for me in Linux. See

MY_PROC macro name:req, numParams:req
  align 16
  proc_numParams = numParams
  if (IS_X64 gt 0)
    proc_name equ name
  elseif (IS_LINUX gt 0)
    proc_name equ name
  elseif (IS_CDECL gt 0)
    proc_name equ @CatStr(_,name)
  else
    proc_name equ @CatStr(@,name,@, %numParams * 4)
  endif
  proc_name PROC
endm

which merely became

%macro MY_PROC 2 ; macro name:req, numParams:req
  align 16
  %define proc_numParams %2 ; numParams
    global %1
    global _%1
    %1:
    _%1:
%endmacro

because I only cared about x64 and Linux. Some of the definitions could be changed en masse. Others, like pointers had to be individually reviewed.

Lastly, I did not care about most of the modules since lrzip-next uses libgcrypt for hashing and encryption. The latest 21.06 version of lzma adds code for LzFind in asm which I added. So other than the decompress functions and the match finder, I ignored the rest.

Good luck with the project. Glad p7zip is back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant