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?
Yes, if you don't change the docs
4%
 4%  [ 1 ]
Yes, if you don't change the docs, and respect the author ( no words like shit, sux ... )
52%
 52%  [ 11 ]
Yes, but only if you don't post it anywhere (internal use)
14%
 14%  [ 3 ]
No, it is not fair to add your name to someone's compo, even if it whould fit in after the optimization
9%
 9%  [ 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
19%
 19%  [ 4 ]
Total Votes : 21

Author
Thread Post new topic Reply to topic
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 24 Sep 2004, 23:59
Well done, but can you beat this "hello world!" for size ? , if so you would be optimising champion Wink .
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!;;*********************************        org   100h        use16        push  0xb800        pop   es        mov   si,0x81        mov   cl,13DoAloop:        lodsb        mov ah,9        stosw        loop DoAloop        ret    


The normal try "hello world!" the best i can do is 21 bytes.

\\\\||////
(@@)
ASHLEY4.
Post 24 Sep 2004, 23:59
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
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 Wink .
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!
;
;*********************************
        org   100h
        use16

        push  0xb800
        pop   es
        mov   si,0x81
        mov   cl,13
DoAloop:
        lodsb
        mov ah,9
        stosw
        loop DoAloop
        ret

    


The normal try "hello world!" the best i can do is 21 bytes.

\\\\||////
(@@)
ASHLEY4.


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: Very Happy
; 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
Post 25 Sep 2004, 00:13
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 25 Sep 2004, 00:14
how whould you like my version? Smile

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
Post 25 Sep 2004, 00:14
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 25 Sep 2004, 00:19
Think! it never hurts Smile

MATRIX
Post 25 Sep 2004, 00:19
View user's profile Send private message Visit poster's website Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 25 Sep 2004, 01:02
Matrix, this is a good site for you Wink .
http://www.xgamestation.com/about_gamestation.php

\\\\||////
(@@)
ASHLEY4.
Post 25 Sep 2004, 01:02
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
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 Wink .
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!
;
;*********************************
        org   100h
        use16

        push  0xb800
        pop   es
        mov   si,0x81
        mov   cl,13
DoAloop:
        lodsb
        mov ah,9
        stosw
        loop DoAloop
        ret

    


The normal try "hello world!" the best i can do is 21 bytes.

\\\\||////
(@@)
ASHLEY4.


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: Very Happy 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 ? Smile

MATRIX
Post 25 Sep 2004, 10:07
View user's profile Send private message Visit poster's website Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 25 Sep 2004, 10:33
I declare Matrix, optimising champion Smile .
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.
Post 25 Sep 2004, 10:33
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
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)
Post 25 Sep 2004, 10:41
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
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 Smile
Post 25 Sep 2004, 11:24
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
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 Smile

MATRIX
Post 25 Sep 2004, 11:45
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
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! , Smile 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
Post 25 Sep 2004, 12:16
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 25 Sep 2004, 15:59
I've a 2000 machine and this was a problem, sorry, now I know
Post 25 Sep 2004, 15:59
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
ASHLEY4 26 Sep 2004, 11:56
Madis731 wrote:
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)


Just checking you did type at the command line "hello hello world!" and assemble the program as a com file called "hello.com" ?

\\\\||////
(@@)
ASHLEY4.
Post 26 Sep 2004, 11:56
View user's profile Send private message Reply with quote
ASHLEY4



Joined: 28 Apr 2004
Posts: 376
Location: UK
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.
Post 26 Sep 2004, 12:08
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 26 Sep 2004, 15:55
I assembled as com (both of them) and @ the cmd.exe wrote:
>hello Tere Maailm!

>_

nothing Neutral

and your 8byte one said:
>hello Tere tulemast Madise maailma!
║ü ┤ ═!├ŗ6©¶.Ä▲¬
¶ā< t►:♦Very Happy☺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
Post 26 Sep 2004, 15:55
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon 26 Sep 2004, 17:22
um matrix, your modified ashley code now duplicates echo... lol
Post 26 Sep 2004, 17:22
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
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 Sad
.localloop: ; you wonder why msg-1 eh? Smile
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 Sad
.localloop: ; you wonder why msg-1 eh? Smile
movsb
inc di
loop .localloop
ret ; we should exit now
msg: db 'Hello World!'
    


code speaks for itself

MATRIX
Post 26 Sep 2004, 22:11
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
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
Post 10 Oct 2004, 01:53
View user's profile Send private message Visit poster's website Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
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
    
[/code]

_________________
It is better to be on the right side of the devil than in his path.
Post 10 Oct 2004, 03:41
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 10 Oct 2004, 14:40
Sorry i have to tell you Sad
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
Post 10 Oct 2004, 14:40
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.