Deutsch   English   Français   Italiano  
<vep1g9$2bq2t$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: DFS <nospam@dfs.com>
Newsgroups: comp.os.linux.advocacy
Subject: Re: Tough asm challenge for "REAL MAN PROGRAMMER" Feeb
Date: Wed, 16 Oct 2024 14:43:22 -0400
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <vep1g9$2bq2t$1@dont-email.me>
References: <veoqp3$2a45g$1@dont-email.me> <lnacrjFt8jeU2@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 16 Oct 2024 20:43:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a97318da1a9567331d205b22340f70b7";
	logging-data="2484317"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+4U+SijGYjGBCtg7WhuKQ1"
User-Agent: Betterbird (Windows)
Cancel-Lock: sha1:GEFSlNTbTEplqrvEIdJC2oQM7aQ=
Content-Language: en-US
In-Reply-To: <lnacrjFt8jeU2@mid.individual.net>
Bytes: 3357

On 10/16/2024 1:52 PM, vallor wrote:
> On Wed, 16 Oct 2024 12:48:35 -0400, DFS <nospam@dfs.com> wrote in
> <veoqp3$2a45g$1@dont-email.me>:
> 
>> This challenge should be right up your alley, given your claims:
>>
>> -------------------------------------------------------------------
>> _I_ am a REAL MAN PROGRAMMER
>>
>> C programmer extraordinaire
>>
>> Assembly language genius
>>
>> I am a FOSS person.  I can do anything and everything and I can do it
>> all extremely well.
>> -------------------------------------------------------------------
>>
>> Challenge:
>> Use nasm to deliver the assembly for the smallest possible working Linux
>> ELF x86 executable that does what this C program does:
>>
>> int main(void) { return 61; }
>>
>> That's it.  Return 61 to the OS.  That's the whole challenge.
>>
>> It goes without saying you can't plagiarize from the Internet or
>> anywhere else (which is where your fraudulent mind went first of
>> course).
>>
>> If you do it right, your solution should be approx 1/50th the size of
>> the smallest tcc (not bloated gcc) executable you could create with the
>> C code.
>>
>> ------------------------------------
>> $ dir tiny.c
>>
>> $ cat tiny.c int main(void) { return 61; }
>>
>> $ tcc -v tcc version 0.9.27 (x86_64 Linux)
>>
>> $ tcc -Wall tiny.c -o t.out
>>
>> $ dir t.out  tiny.c
>>
>> $ ./t.out; echo $?
>> 61
>>
>> $ nm t.out nm: t.out: no symbols
>>
 >> $ wc -c t.out 2736 t.out
 >> ------------------------------------>>
>> I can't hear the crickets yet... but I know they're coming soon.



> $ wc -c return_61
 > 248 return_61
 > > I had to look at some example programs to write the
> asm file, 


Whilst the Cola Committee for Coding Challenges (CCCC) appreciates your 
efforts, we must inform you that your faux submission is rejected for 
admittance of violation of the no-plagiarism directive.



> then poured over the ld(1) documentation
> for linker options.

pored


> I guess I'm not a "REAL MAN PROGRAMMER", can't figure out
> how to get it any smaller.

REAL MAN PROGRAMMERS can get it down to 45 bytes (seriously).


> However, THIS!  IS!  LINUX!  So:
> 
> $ wc -c return_61
> 8 return_61
> $ ./return_61 ; echo $?
> 61

 From 248 to 8?  huh?