flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
jorom 17 Dec 2004, 21:29
In institute have set such task: to make the program "Hello world!" in the size no more than 16 bytes! It is real?
_________________ sorry for my english |
|||
![]() |
|
mike.dld 18 Dec 2004, 00:50
Code: mov ah,9 mov dx,$82 int $21 ret compile to hello.com and use as hello Hello, World!$ |
|||
![]() |
|
jorom 18 Dec 2004, 20:41
no command line use!
opcodes? |
|||
![]() |
|
beppe85 18 Dec 2004, 22:33
Hello world! by its own have 16 bytes...
|
|||
![]() |
|
JohnFound 18 Dec 2004, 22:49
beppe85 wrote: Hello world! by its own have 16 bytes... only 12. ![]() |
|||
![]() |
|
vid 18 Dec 2004, 23:33
maybe use some bytes of string as instructions?
|
|||
![]() |
|
jorom 19 Dec 2004, 00:25
It is necessary to code each symbol in several bits
.... ???? |
|||
![]() |
|
roticv 19 Dec 2004, 08:22
vid, not possible I think
|
|||
![]() |
|
JohnFound 19 Dec 2004, 08:59
if we make all chars lower case and sub $60 from every one, the most of them will become 4bit.
![]() |
|||
![]() |
|
vid 19 Dec 2004, 12:23
isn't there something in dos that exits and displays string? such call could fit into 4 bytes.
Maybe you COULD use "$" or "d$" as some instruction, too bad i am now under linux with which i am unfamiliar and where i don't have HIEW to try... JohnFound: decompression would take too much place then. One trick that will save one byte - instead of "$" you could pass CTRL-C character, so retn wouldn't be needed |
|||
![]() |
|
Madis731 21 Dec 2004, 22:23
Well, asmdaemon fit pallette in 32bytes and it was beautiful:)
|
|||
![]() |
|
fasm9 22 Dec 2004, 22:01
hello.exe written in c(dev-cpp 4.9.9.1) with upx is 3kb, which is less than 4kb.
so what's different 12byte and 4kb?? -- |
|||
![]() |
|
polygon7 23 Dec 2004, 11:51
fasm9 wrote: hello.exe written in c(dev-cpp 4.9.9.1) with upx is 3kb, which is less than 4kb. For simple "hello world" 4kb is too large. With MSVC 6.0 you can make it in 1kb (without exe compression, src in attachement). I think that is possible to make 1kb "Hello World" in Dev-cpp too. For compresion such small files best compressor is FSG 2.0
_________________ best regards p7 |
|||||||||||
![]() |
|
JohnFound 23 Dec 2004, 13:41
AFAIR, the task was for 16 bytes DOS .com file "Hello world"...
![]() I have a feeling that it is possible. Jorom, what exactly is the string that have to printed? "Hello world!" or "Hello world" or even "hello world"? Regards |
|||
![]() |
|
Madis731 23 Dec 2004, 14:17
Yes, that's right - if you can ignore the case you might pack those ll.....l-s and o..o-s with only h, e, w, r and d in singular
![]() someone suggested packing them in 4 bits - so printing with (char+65) in not much of an overhead thinking of unpacking in mind... What do you guys think. Haven't dealt with com programming much - just a theory. |
|||
![]() |
|
iklin 24 Dec 2004, 16:56
FSG doesn't do the trick for fasm.
![]() ![]() |
|||
![]() |
|
Nikolay Petrov 27 Dec 2004, 22:30
jorom wrote: In institute have set such task: to make the program "Hello world!" in the size no more than 16 bytes! It is real? ![]() |
|||
![]() |
|
Madis731 28 Dec 2004, 11:10
FASMW->Options->Appearance
is EXACTLY 16bytes (with listing) Code: org 256 txt db "HELLO!$" ;48 45 4C 4C 4F 21 24 Trasl: ;DEC AX ;INC BP ;DEC SP ;DEC SP ;AND [SI],SP mov ah,9 ;B4 09 mov dx,txt ;BA 09 01 int 33 ;CD 21 int 32 ;CD 20 ;"HELLO WORLD!$" ;db 48 45 4C 4C 4F 20 57 4F 52 4C 44 21 24 Trasl2: ;DEC AX ;INC BP ;DEC SP ;DEC SP ;DEC DI ;AND [BX+4Fh],DL ;PUSH DX ;DEC SP ;INC SP ;AND [SI],SP ;"TERE,MAAILM!$" Maybe in Estonian (rules state that there must be a comma) ;db 54 45 52 45 2C 4D 41 41 49 4C 4D 21 24 Trasl3: ;PUSH SP ;INC BP ;PUSH DX ;INC BP ;SUB AL,4Dh ;INC CX ;INC CX ;DEC CX ;DEC SP ;DEC BP ;AND [SI],SP but you can't have more than 6 characters ![]() but if you remove that "$", then you'll have a bunch of other unwanted characters and a fifteen-byte-program ![]() Last edited by Madis731 on 28 Dec 2004, 12:18; edited 1 time in total |
|||
![]() |
|
bubach 28 Dec 2004, 12:16
do the program need to exit?
|
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.