#include "asmcpp.h"
#define t dword [ebp+16]
#define u dword [ebp+20]
MUL32(t, 2, 3); // こんな感じで書けたらいいよねー.
ADD32(u, 1, t);
#undef t
#undef u#define ADD32(z, x, y) \
mov eax,x; \
add eax,y; \
mov z,eax;
#define MUL32(z, x, y) \
mov eax,x; \
imul eax,y; \
mov z,eax;prompt>gcc -E -o out.txt test.c
# 1 "test.c" # 1 "<built-in>" # 1 "<command-line>" # 1 "test.c" # 1 "asmcpp.h" 1 # 2 "test.c" 2 mov eax,2; imul eax,3; mov dword [ebp+16],eax;; mov eax,1; add eax,dword [ebp+16]; mov dword [ebp+20],eax;;