I was playing with Brian Ingerson's excellent Inline.pm and
decided to do something funky. This only works on i386/Linux
(Well, it might work on BSD. I think the syscalls are the same. Haven't tested it.)
#!/usr/bin/perl -w
use strict;
use less 'on non-i386 architectures';
&japh("japh!");
use Inline C => <<'JAPH';
int japh(char *j)
{
asm ("
jmp jap_h
j_aph:
popl %ecx
xorl %eax, %eax
incb %al
movl %eax, %ebx
shl $0x2, %al
movl %ebx, %edx
shl $0x4, %dl
addb $0xa, %dl
int $0x80
xorl %eax, %eax
incb %al
int $0x80
jap_h:
call j_aph
.asciz \"Just Another Perl Hacker.\\n\"
");
}
JAPH
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.