#1

Quote:
Originally Posted by ******
Посмотреть сообщение
...
Nice find ******! This also allows inserting code at the end of a line!

pawn Код:
#define EAT_LINE:%0\10;%1 The line contained: <%0> nom nom

EAT_LINE:boop boop () {}
Reply
#2

Wonderful! I just wrote a new new macro for asm.inc using this trick

pawn Код:
// Looks pretty much like inline assembly
@emit proc      ;
@emit push_s    12;
@emit push_c    4;
@emit sysreq_d  GetNativeAddressFromName("print");
@emit stack     8;
@emit retn      ;
Edit:

Oh, and today I learned how to include spaces in macros!
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Ha! You beat me to it... There is a note on the corner of the bit of paper in front of me that just says "@emit", reminding me to write exactly that macro later tonight (I went for @emit instead of just emit as I thought it looked more like #emit, but that's a minor point).
Hmm, that's actually a good idea, it looks even better that way
Reply
#4

Quote:
Originally Posted by xeeZ
Посмотреть сообщение
Wonderful! I just wrote a new new macro for asm.inc using this trick

pawn Код:
// Looks pretty much like inline assembly
@emit proc      ;
@emit push_s    12;
@emit push_c    4;
@emit sysreq_d  GetNativeAddressFromName("print");
@emit stack     8;
@emit retn      ;
Edit:

Oh, and today I learned how to include spaces in macros!
You could match \10 in the end to avoid the semicolon.

pawn Код:
#define @emit%0\32;%1\32;%2\10; asm_emit_%1(ctx, %2);
Reply
#5

@******:
It doesn't, actually. The lst will show the output without the newline character, but it still counts it as a new line.

I tried putting a bunch of them together, which ended up with 4000 chars on one line, but it compiled just fine.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)