嵌入式运行时汇编器 Erasm++

码农软件 · 软件分类 · 其他开发相关 · 2019-10-25 11:12:21

软件介绍

Erasm++ 基于 C++ 的嵌入式运行时汇编器,是一个 C++ 的 Embedded Domain Specific Language (EDSL) 用于运行时生成代码。支持完整的编译时语法检查,其代码生成速度非常快,因为必须的数据已经做了静态计算,目前只支持 Intel 64 和 IA-32 体系架构。

示例代码:

#include <erasm/x64_addr64_data32.hpp>
#include <iostream>

typedef int (*pf_t) (int);

int main(int argc,char**argv)
{
   using namespace std;
   using namespace erasm::x64;
   using namespace erasm::x64::addr64;
   using namespace erasm::x64::addr64::data32;

   byte_t buf[100];
   byte_t *p = buf;
   int32_t x = 2;

   p += mov(p,rax,dword_ptr[rsp+8]);
   p += add(p,rax,x);
   p += ret(p);

   pf_t f = (pf_t)buf;   
   int len = p - buf;
   cout  << "code length=" << len << endl
	 << "result=" << f(argc) << endl;
   return 0;
}

本文地址:https://codercto.com/soft/d/17521.html

Principles of Object-Oriented JavaScript

Principles of Object-Oriented JavaScript

Nicholas C. Zakas / No Starch Press / 2014-2 / USD 24.95

If you've used a more traditional object-oriented language, such as C++ or Java, JavaScript probably doesn't seem object-oriented at all. It has no concept of classes, and you don't even need to defin......一起来看看 《Principles of Object-Oriented JavaScript》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

随机密码生成器
随机密码生成器

多种字符组合密码