flat assembler
Message board for the users of flat assembler.
Index
> Main > Modified Compos Goto page Previous 1, 2, 3 Next |
Do you think it is a fair thing to optimize someone's compo, and then add your credit? | |||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||
Total Votes : 21 |
Author |
|
Matrix 25 Sep 2004, 00:13
ASHLEY4 wrote: Well done, but can you beat this "hello world!" for size ? , if so you would be optimising champion . Code: ;********************************* ; \\|// Is it the smallest ? ; (@ @) "HELLO WORLD!" ; ASHLEY4. 16 Byte's ; ; Assemble with Fasm. ; c:\fasm hello.asm hello.com ; ; At the dos commandline type: ; c:\hello hello world! ; ;********************************* ; MATRIX RECOMMENDS THIS PIECE OF CODE TO ASHLEY4 ; Assemble with Fasm. ; c:\fasm helloZ.asm helloZ.com ; ; At the dos commandline type: ; c:\helloZ.com aHaEaLaLaOa aWaOaRaLaDa! ; ; ADDITIONAL COMMENTS: ; PS.: MATRIX HAS YOU org 100h use16 push 0xb800 pop es mov si,0x81 mov cl,13 ;DoAloop: rep movsw ; loop DoAloop ret it is 12 bytes for me MATRIX Last edited by Matrix on 25 Sep 2004, 00:25; edited 1 time in total |
|||
25 Sep 2004, 00:13 |
|
Matrix 25 Sep 2004, 00:14
how whould you like my version?
Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;File: hell.asm; heavily commented hell fire demo using fasm 1.53 ;; ;;Author: AsmDemon asmdemon@cox.net ;; ;;Date: August 8, 2004 ;; ;;Use: Compo #9 modified from compo #8 ;; ;;IRC: #asm Web: http://members.cox.net/asmdemom/ ;; ;;Greetz to kalipara, mov, and others ;; ;;It is better to be on the right side of the devil than in his path.;; ;;R.A.C. 11131983 0x41 0x73 0x6d 0x44 0x65 0x6d 0x6f 0x6e ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;MODIFIED BY MATRIX;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;Change 8/24/04 added exit, made it blue moving rain, still under 32b ;;;;;;;;;;;;;;;;;; ;;Code Starts at;; ;; offset 100h ;; ;; using 16-bit ;; ;;;;;;;;;;;;;;;;;; $=0x0100 use16 ;;;;;;;;;;;;;;;;;;; ;;Set Screen mode;; ;;to 320x200x256 ;; ;;;;;;;;;;;;;;;;;;; mov al, 0x13 int 0x10 ;;;;;;;;;;;;;;;;;;;;; ;;Select Buffer for;; ;;output to screen.;; ;;;;;;;;;;;;;;;;;;;;; LES BP, [BX] ;;;;;;;;;;;;;;;;; ;; Set Color to;; ;; red scale ;; ;;;;;;;;;;;;;;;;; mov dx, 0x03c9 ;;;;;;;;;;;;;;;;;;;;; ;;Main Program Loop;; ;;;;;;;;;;;;;;;;;;;;; mainloop: adc bx, cx mov ax, bx stosb xchg ax,cx xchg di, ax out dx, al out dx, al xchg di, ax out dx, al xchg ax,cx loop mainloop ; minus 1 from cx stosb inc bx mov ah,1 int 16h jz mainloop ret ( it is 32 bytes ) MATRIX |
|||
25 Sep 2004, 00:14 |
|
Matrix 25 Sep 2004, 00:19
Think! it never hurts
MATRIX |
|||
25 Sep 2004, 00:19 |
|
ASHLEY4 25 Sep 2004, 01:02
Matrix, this is a good site for you .
http://www.xgamestation.com/about_gamestation.php \\\\||//// (@@) ASHLEY4. |
|||
25 Sep 2004, 01:02 |
|
Matrix 25 Sep 2004, 10:07
ASHLEY4 wrote: Well done, but can you beat this "hello world!" for size ? , if so you would be optimising champion . Code: ;********************************* ; \\|// Is it the smallest ? ; (@ @) "HELLO WORLD!" ; ASHLEY4. 16 Byte's ; ; Assemble with Fasm. ; c:\fasm hello.asm hello.com ; ; At the dos commandline type: ; c:\hello hello world! ; ;********************************* ; MATRIX RECOMMENDS THIS PIECE OF CODE TO ASHLEY4 ; Assemble with Fasm. ; c:\fasm helloZD.asm helloZD.com ; ; At the dos commandline type: ; c:\helloZD.com HELLO WORLD!$ ; ; ADDITIONAL COMMENTS: NOW ITS 8 BYTES ; PS.: MATRIX HAS YOU org 256 use16 mov dx,81h mov ah,9 int 21h ret now its 8 bytes what do you think ? MATRIX |
|||
25 Sep 2004, 10:07 |
|
ASHLEY4 25 Sep 2004, 10:33
I declare Matrix, optimising champion .
You should of entered the 512b compo, and then you may of bean 512b champion, the winner go in the hall of fame, and we have to call him/her SIR, on the forum. "Sir Matrix" sounds good, but only 5 days left. \\\\||//// (@@) ASHLEY4. |
|||
25 Sep 2004, 10:33 |
|
Madis731 25 Sep 2004, 10:41
Ok, this is strange:
Neither of the programs work(maybe its because of Windows) but they act very differently. The 16byte one doesn't print anything or does it? (skips a line so I assume that at least 80 nonprintable chars are there) That 8byte one print some emty stace and some chars alltogether 92characters, but none of mine(same result with no parameters) |
|||
25 Sep 2004, 10:41 |
|
crc 25 Sep 2004, 11:24
It is worth noting that these aren't really "Hello World" programs, but "display the command line arguments" programs
|
|||
25 Sep 2004, 11:24 |
|
Matrix 25 Sep 2004, 11:45
Hy,
well Madis731, it works under win98se, exactly it is writing the parameters passed to the com file by dos, what system do you have? the 8 bytes one prints it via dos interrupt, so prints bytes from ds:81h to the first $ character. maeby you have parameters at a different address? crc , you 're right, cause it is not really a hello world program, you could enter this at the command line too: echo Hello World! , so this way you don't need a com file anymore MATRIX |
|||
25 Sep 2004, 11:45 |
|
Matrix 25 Sep 2004, 12:16
Hy,
i have made a real "Hello World!" program for those who were looking for a small one, i have even added a special feature: it even prints its own code before Hello World! , and all this at 20 bytes! Code: org 256 mov ah,9 mov dx,si int 21h ret msg db 'Hello World!$' of course it assumes si=$100 and uses dos print string function so it requres full dos compatibility. MATRIX |
|||
25 Sep 2004, 12:16 |
|
Madis731 25 Sep 2004, 15:59
I've a 2000 machine and this was a problem, sorry, now I know
|
|||
25 Sep 2004, 15:59 |
|
ASHLEY4 26 Sep 2004, 11:56
Madis731 wrote: Ok, this is strange: Just checking you did type at the command line "hello hello world!" and assemble the program as a com file called "hello.com" ? \\\\||//// (@@) ASHLEY4. |
|||
26 Sep 2004, 11:56 |
|
ASHLEY4 26 Sep 2004, 12:08
The smallest hello world! compo, rule's said that, it must be a COM/EXE and print hello world! when run from dos, But can not use any dos int's.
\\\\||//// (@@) ASHLEY4. |
|||
26 Sep 2004, 12:08 |
|
Madis731 26 Sep 2004, 15:55
I assembled as com (both of them) and @ the cmd.exe wrote:
>hello Tere Maailm! >_ nothing and your 8byte one said: >hello Tere tulemast Madise maailma! ║ü ┤ ═!├ŗ6©¶.Ä▲¬ ¶ā< t►:♦☺w♥∙ļ♣FFļļ°[^▼├Ä∟ ♥×∟¦∟░∟♥╣∟Ų∟ę∟ ☺Ā☻ ▀∟▐∟ ☺Ć ▀ >_ familiar? Yes, and "hello hello world" didn't work either, but it does not matter what you write there. That last one works fine: some garbish(your code) and then hello world |
|||
26 Sep 2004, 15:55 |
|
asmdemon 26 Sep 2004, 17:22
um matrix, your modified ashley code now duplicates echo... lol
|
|||
26 Sep 2004, 17:22 |
|
Matrix 26 Sep 2004, 22:11
Code: ; Smallest Direct Hello World! by MATRIX ; 21/26 bytes org 100h use16 mov ah,$b8 push ax pop es ;mov cl,13 ; comment these lines if you don't like writing $ff bytes and ;mov si,msg-1; you don't like displaying the code, adds 5 bytes .localloop: ; you wonder why msg-1 eh? movsb inc di loop .localloop ret ; we should exit now msg: db 'Hello World!' Code: ; #2 Smallest Direct Hello World! by MATRIX ; 21/26 bytes org 100h use16 mov ah,$b8 mov es,ax ;mov cl,13 ; comment these lines if you don't like writing $ff bytes and ;mov si,msg-1; you don't like displaying the code, adds 5 bytes .localloop: ; you wonder why msg-1 eh? movsb inc di loop .localloop ret ; we should exit now msg: db 'Hello World!' code speaks for itself MATRIX |
|||
26 Sep 2004, 22:11 |
|
Matrix 10 Oct 2004, 01:53
Hy all,
depending on the current poll votes: Yes, if you don't change the docs 6% [ 1 ] Yes, if you don't change the docs, and respect the author ( no words like shit, sux ... ) 53% [ 8 ] Yes, but only if you don't post it anywhere (internal use) 6% [ 1 ] No, it is not fair to add your name to someone's compo, even if it whould fit in after the optimization 13% [ 2 ] No, compo's are made by the author and are as is, and no subject to change, they're the way they meant to be implemented 20% [ 3 ] i guess we can say most people don't mind if someone respects his/her code and modifies it. however not many votes, but this might be because people were satisfied with the ratings. if noone minds i will make some compos modified/enhanced by me a zip attachment with originals. so if you have similiar things you can post them too. MATRIX |
|||
10 Oct 2004, 01:53 |
|
asmdemon 10 Oct 2004, 03:41
sorry for the sudden correction, but i found the old code that i did...
MATRIX, your code is nice, but i found where my bytes went... in 0x60 instead of mov ah,1 / int 16 Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;File: hell.asm; heavily commented hell fire demo using fasm 1.53 ;; ;;Author: AsmDemon asmdemon@cox.net ;; ;;Date: August 8, 2004 ;; ;;Use: Compo #9 modified from compo #8 ;; ;;IRC: #asm Web: http://members.cox.net/asmdemom/ ;; ;;Greetz to kalipara, mov, and others ;; ;;It is better to be on the right side of the devil than in his path.;; ;;R.A.C. 11131983 0x41 0x73 0x6d 0x44 0x65 0x6d 0x6f 0x6e ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;; ;;Code Starts at;; ;; offset 100h ;; ;; using 16-bit ;; ;;;;;;;;;;;;;;;;;; $=0x0100 use16 ;;;;;;;;;;;;;;;;;;; ;;Set Screen mode;; ;;to 320x200x256 ;; ;;;;;;;;;;;;;;;;;;; mov al, 0x13 int 0x10 ;;;;;;;;;;;;;;;;;;;;; ;;Select Buffer for;; ;;output to screen.;; ;;;;;;;;;;;;;;;;;;;;; LES cx, [BX] ;;;;;;;;;;;;;;;;; ;; Set Color to;; ;; red scale ;; ;;;;;;;;;;;;;;;;; mov dx, 0x03c9 setcolor: xchg bx, ax out dx, al out dx, al xchg bx, ax out dx, al inc ax jnz setcolor ;;;;;;;;;;;;;;;;;;;;; ;;Main Program Loop;; ;;;;;;;;;;;;;;;;;;;;;;; ;;set adc ax, 0x0001 ;; ;;this fixes demo 8 ;; ;;shows what I wanted;; ;;;;;;;;;;;;;;;;;;;;;;; mainloop: adc bx, cx mov ax, bx stosb loop mainloop ; minus 1 from cx stosb inc bx in ax, 0x60 dec ax jnz mainloop ret _________________ It is better to be on the right side of the devil than in his path. |
|||
10 Oct 2004, 03:41 |
|
Matrix 10 Oct 2004, 14:40
Sorry i have to tell you
but $60 is a byte port, hence , you will lose 1 bytes. @ dec al Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;File: hell.asm; heavily commented hell fire demo using fasm 1.53 ;; ;;Author: AsmDemon asmdemon@cox.net ;; ;;Date: August 8, 2004 ;; ;;Use: Compo #9 modified from compo #8 ;; ;;IRC: #asm Web: http://members.cox.net/asmdemom/ ;; ;;Greetz to kalipara, mov, and others ;; ;;It is better to be on the right side of the devil than in his path.;; ;;R.A.C. 11131983 0x41 0x73 0x6d 0x44 0x65 0x6d 0x6f 0x6e ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;; ;;Code Starts at;; ;; offset 100h ;; ;; using 16-bit ;; ;;;;;;;;;;;;;;;;;; org 256 use16 ;;;;;;;;;;;;;;;;;;; ;;Set Screen mode;; ;;to 320x200x256 ;; ;;;;;;;;;;;;;;;;;;; mov al,0x13 int 0x10 ;;;;;;;;;;;;;;;;;;;;; ;;Select Buffer for;; ;;output to screen.;; ;;;;;;;;;;;;;;;;;;;;; LES cx, [BX] ;;;;;;;;;;;;;;;;; ;; Set Color to;; ;; red scale ;; ;;;;;;;;;;;;;;;;; mov dx, 0x03c9 setcolor: xchg bx, ax out dx, al out dx, al xchg bx, ax out dx, al inc ax jnz setcolor ;;;;;;;;;;;;;;;;;;;;; ;;Main Program Loop;; ;;;;;;;;;;;;;;;;;;;;;;; ;;set adc ax, 0x0001 ;; ;;this fixes demo 8 ;; ;;shows what I wanted;; ;;;;;;;;;;;;;;;;;;;;;;; mainloop: adc bx, cx mov ax, bx stosb loop mainloop ; minus 1 from cx ;stosb ; sorry, this doesn't fit in 32 bytes inc bx in al, 0x60 ; ax,$60 dec al ;ax jnz mainloop ret MATRIX |
|||
10 Oct 2004, 14:40 |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.