在 64 位应用程序中使用为 32 位编写的汇编代码 [英] Using assembly code written for 32-bit in 64-bit application

查看:27
本文介绍了在 64 位应用程序中使用为 32 位编写的汇编代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在 x86-64 机器上的 64 位程序中使用下面链接中为 32 位 x86 编写的用于 Serpent 加密的汇编例程吗?也就是说,不为它启动一个单独的 32 位进程?如果没有,有没有人有一个可以在 32 位和 64 位上工作的 Serpent 优化实现的指针(LGPL 可以,但不能使用 GPL,因为它是一个商业项目)?http://gladman.plushost.co.uk/oldsite/cryptography_technology/serpent/serpent.asm

Can I use the assembly routines for Serpent encryption in the link below written for 32-bit x86 from a 64-bit program on an x86-64 machine? That is, without launching a separate 32-bit process for it? If not, does anyone have a pointer to an optimized implementation of Serpent that works in both 32 and 64 bit (LGPL is OK but cannot use GPL since it's a commercial project)? http://gladman.plushost.co.uk/oldsite/cryptography_technology/serpent/serpent.asm

推荐答案

您需要转换将结果和数据传入/传出内存的代码部分,以使用 64 位地址寄存器.此外,堆栈操作代码将需要使用 64 位堆栈寄存器.除此之外,它可能无需重大更改即可工作.

You will need to convert the portions of the code that transfer the results and data to/from memory to use 64-bit address registers. Also, stack manipulation code will need to use the 64-bit stack registers. Other than that, it's likely to work without major changes.

这篇关于在 64 位应用程序中使用为 32 位编写的汇编代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆