Re: Tough asm challenge for "REAL MAN PROGRAMMER" Feeb

Liste des GroupesRevenir à col advocacy 
Sujet : Re: Tough asm challenge for "REAL MAN PROGRAMMER" Feeb
De : nospam (at) *nospam* dfs.com (DFS)
Groupes : comp.os.linux.advocacy
Date : 16. Oct 2024, 19:43:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vep1g9$2bq2t$1@dont-email.me>
References : 1 2
User-Agent : Betterbird (Windows)
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?

Date Sujet#  Auteur
16 Oct 24 * Tough asm challenge for "REAL MAN PROGRAMMER" Feeb6DFS
16 Oct 24 `* Re: Tough asm challenge for "REAL MAN PROGRAMMER" Feeb5vallor
16 Oct 24  `* Re: Tough asm challenge for "REAL MAN PROGRAMMER" Feeb4DFS
16 Oct 24   +- Re: Tough asm challenge for "REAL MAN PROGRAMMER" Feeb1DFS
16 Oct 24   `* Re: Tough asm challenge for "REAL MAN PROGRAMMER" Feeb2vallor
16 Oct 24    `- Re: Tough asm challenge for "REAL MAN PROGRAMMER" Feeb1DFS

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal