Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.msdos.programmer > #629
| From | pete@nospam.demon.co.uk |
|---|---|
| Newsgroups | comp.os.msdos.programmer |
| Subject | A (UK) celebration |
| Date | 2012-06-03 07:46 +0000 |
| Organization | PDL |
| Message-ID | <1338709568snz@nospam.demon.co.uk> (permalink) |
I wrote the following piece of code around 15 years ago in connection
with the IOCCC Obfuscated C competition and it has just sat on my PC
doing nothing since then. You might be aware that the UK is celebrating
its Queen's 60th year on the throne this weekend, so now seemed an
appropriate time to re-release this piece of fripperie, just for a bit
of fun. It is for pure MSDOS; Windows? forget it!
It compiles straight out of the box for MSC 5.1 but might need some
tweaking for other (16 bit DOS) compilers. You might need to redefine
_I_ and/or _O_ if your lib uses different names for inp() and outp()
to access the hardware. For example if your IN and OUT functions are
called inb() and outb(), compile using
$(cc) -D_I_=inb -D_O_=outb -o jubilee.exe jubilee.c
(best viewed using a fixed pitch font)
-------- Start jubilee.c --------
#ifndef _I_
#define _I_ inp
#endif
#ifndef _O_
#define _O_ outp
#endif
#define I int
#define C char
#define L long
#define V void
#define S static
#define R register
#define U unsigned
L m[]={0x08E90801L,0x08E90801L,0x07F00801L,0x096F1001L,0x08E90301L,0x7F00802L,
0x07120801L,0x07120801L,0x06AD0801L,/*00*/0x07121001L,0x07F00301L,0x08E90802L,
0x07F00801L, 0x08E90801L, 0x096F0801L,
/**/0x08E90802L, 0x08E90201L, 0x07F00201L,/**/
/* */0x07120201L, 0x06AD0202L, 0x05F10801L,/* */
/* */0x05F10801L, 0x05F10801L, 0x05F11001L,/* */
/* */0x06AD0301L, 0x07120802L, 0x06AD0801L,/* */
/* */0x06AD0801L, 0x06AD0801L, 0x06AD1001L,/* */
/*00000*/0x07120301L,0x07F00802L,0x07120801L,0x06AD0201L,0x07120201L,/*00000*/
/*00000*/0x07F00201L,0x08E90201L,0x07121001L,0x06AD0301L,0x05F10802L,/*00000*/
/*00000*/0x054B0301L,0x06AD0301L,0x07120C01L,0x07F00C01L,0x08E91001L,/*00000*/
0L} ;S V _0_(),_1_ ();I main() {R L *p;for(p=m; *p
!= 0L;p++)_1_(p); return(0);} S V _1_(s)R U C *s
;{ _O_(0x43,0xb6); _O_(0x42,s[2] );_O_(0x42,s[ 3]
); _O_(0x61,_I_( 0x61)|3);_0_ (s[1]);_O_(0x61,/**/
_I_(0x61)&~3); _0_(s[0]);}/* 0000000000000 */
#define K (*(U I far*) 0x46cL)/***/
S V _0_ (t) R U I t;{R U I n;++t;do{n=K;while(n==K);}while(--t);}/*0x7F00802L,
0x07120801L,0x07120801L,0x06AD0801L,0x07121001L,0x07F00301L,0x08E90802L,0000*/
-------- End jubilee.c --------
Enjoy!
Pete
--
Believe those who are seeking the truth.
Doubt those who find it. - André Gide
Back to comp.os.msdos.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
A (UK) celebration pete@nospam.demon.co.uk - 2012-06-03 07:46 +0000
Re: A (UK) celebration Nomen Nescio <nobody@dizum.com> - 2012-06-03 15:29 +0200
Re: A (UK) celebration "Rod Pemberton" <do_not_have@notemailntt.cmm> - 2012-06-03 17:23 -0400
Re: A (UK) celebration pete@nospam.demon.co.uk - 2012-06-04 06:31 +0000
Re: A (UK) celebration pete@nospam.demon.co.uk - 2012-06-05 13:39 +0000
csiph-web