Hello everyone,
I am having trouble with converting something from C to FASM:
#define _IOC(dir,type,nr,size) \
(((dir) << _IOC_DIRSHIFT) | \
((type) << _IOC_TYPESHIFT) | \
((nr) << _IOC_NRSHIFT) | \
((size) << _IOC_SIZESHIFT))
#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(size))
#define TEST _IOR('t', 90, 4)
Basically I want to make the FASM variant as close to C as possible:
macro _IOC dir,type,nr,size
{((dir shl _IOC_DIRSHIFT) or (type shl _IOC_TYPESHIFT) or (nr shl _IOC_NRSHIFT) or (size shl _IOC_SIZESHIFT))}
macro _IOR type, nr, size {_IOC _IOC_READ, type, nr, size}
TEST equ (_IOR 't', 90, 4) ; <--- the problem.
Is there any way to make FASM to assign a result of a macro instead of the macro invoking string? Or any other way to do this?
Sorry if I posted in a wrong section. Wasn't sure if it should come here or in the main.