flat assembler
Message board for the users of flat assembler.
Index
> DOS > Para512 - 512 byte paratrooper (with sources) Goto page 1, 2 Next |
Author |
|
vid 24 Oct 2006, 00:44
At least i found some time to release this somewhat old thingy.
Sources are included so you can maybe learn few tricks from that. have fun and spread it over the world [edit] This was originally Para513. It was changed to Para512 after optimization idea by ATV
Last edited by vid on 24 Oct 2006, 13:54; edited 1 time in total |
|||||||||||
24 Oct 2006, 00:44 |
|
f0dder 24 Oct 2006, 06:52
Hehe - it needs to be ONE byte smaller though
|
|||
24 Oct 2006, 06:52 |
|
vid 24 Oct 2006, 10:11
no it doesn't!
read the docs and comments in source code |
|||
24 Oct 2006, 10:11 |
|
ATV 24 Oct 2006, 13:04
Very easy 2 bytes remove
Move end_objects: (lines 484-490) before line 323 then one jnb 32bit -> jb 8bit Then it have 511 bytes |
|||
24 Oct 2006, 13:04 |
|
vid 24 Oct 2006, 13:54
great, why didn't i think about it?
so i am migrating to Para512 |
|||
24 Oct 2006, 13:54 |
|
rugxulo 24 Oct 2006, 16:26
One quick comment: the above .ZIP is made by which compressor? I'm just curious as to why the compressed size of the .COM is 516 bytes (uses Deflate even though Stored would be better!).
In other words, Info-Zip would compress smaller. |
|||
24 Oct 2006, 16:26 |
|
vid 24 Oct 2006, 17:13
Total Commander builtin ZIP
|
|||
24 Oct 2006, 17:13 |
|
sylwek32 24 Oct 2006, 21:09
hey vid, maybe you should publish it to pouet.net ?
|
|||
24 Oct 2006, 21:09 |
|
vid 24 Oct 2006, 21:46
it's public domain, feel free to send anywhere for me. i don't know many sites on this
|
|||
24 Oct 2006, 21:46 |
|
sylwek32 24 Oct 2006, 23:41
I have published it at
http://pouet.net/prod.php?which=26868 |
|||
24 Oct 2006, 23:41 |
|
vid 25 Oct 2006, 00:27
thx
|
|||
25 Oct 2006, 00:27 |
|
sylwek32 25 Oct 2006, 00:55
no problem..
I am currently working on a 32byte program in fasm.. Maybe you can help me.. |
|||
25 Oct 2006, 00:55 |
|
vid 25 Oct 2006, 09:33
just post your question(s)
|
|||
25 Oct 2006, 09:33 |
|
vid 25 Oct 2006, 11:59
"mov [es:di],al" -> stosb
why do you call int 21h/ah=10/dx=" " ??? |
|||
25 Oct 2006, 11:59 |
|
ATV 26 Oct 2006, 07:05
Second look of paratrooper
Code: line 97 save 1 byte inc al -> inc ax line 152- movzx dx,byte [bp + angletab-BPVAL + si] shld bx,dx,12 ;BL = high 4 bits (y gun size) and dl,0Fh ;DL = low 4 bits (x gun size), DH=0 (counter of y overlap) mov bh,bl ;BH = y size (counter of Y loops) new 152- save 2 bytes mov al,byte [bp + angletab-BPVAL + si] aam 10h movzx dx,al ;DL = low 4 bits (x gun size), DH=0 (counter of y overlap) xchg ax,bx ;BH = y size (counter of Y loops) mov bl,bh ;BL = high 4 bits (y gun size) line 215- mov al,ah cbw ;------------------------------------------------------------------ ;ESC dec ax jz exit ;----------------------------------------------------------------- ;check left key mov cl,byte [bp+dir-BPVAL] sub al,4Bh-1 jz change_gun_angle new 216- save 3 bytes (and uses keys j,k,l = works also in laptop) cbw ;------------------------------------------------------------------ ;ESC cmp al,27 jnz dont_exit ;expensive 4byte jz removed ret dont_exit: ;----------------------------------------------------------------- ;check left key mov cl,byte [bp+dir-BPVAL] sub al,'k'-1 jz change_gun_angle lines 358,360,364,366,505 mov can be replace with xchg (save 5 bytes) total 512-11=501 bytes (soon there is room for score handling) |
|||
26 Oct 2006, 07:05 |
|
vid 26 Oct 2006, 10:20
about first: i knew i shold study "AAM", it is used in every optimizing compo. i was just too lazy
second: matter of taste, i wanted not to affect playability xchg ax: great idea! seems you've done some optimizations before |
|||
26 Oct 2006, 10:20 |
|
vid 26 Oct 2006, 10:36
so, i tried your tricks, work well. By the way, moving to JKL only saves one byte, so i will keep numeric arrow keys for now, until that one byte is strongly needed.
thx for interest. do you have any idea HOW could the score work? There could be end-after-4-parachutist-on-ground, similar to original. |
|||
26 Oct 2006, 10:36 |
|
ATV 26 Oct 2006, 11:04
Tetris like game in Hugi Compo 22
http://www.hugi.scene.org/compo/compoold.htm#compo22 has score handling, maybe little over 20 bytes. |
|||
26 Oct 2006, 11:04 |
|
sylwek32 26 Oct 2006, 11:06
vid:
why do you call int 21h/ah=10/dx=" " ??? it was dx=" x" i forgot to write a x behind of that Code: org 100h ; .COM + 0 Byte MOV AL, 13H ; + 2 Bytes INT 10H ; + 2 Bytes UX: ; INC BYTE [2] ; + 4 Bytes MOV DX, " x" ; + 3 Bytes MOV AH, 10H ; + 2 Bytes INT 21H ; + 2 Bytes LES BP, [BX] ; + 2 Bytes PUSH DI ; + 1 Byte ADD DI, CX ; + 2 Bytes MOV AL, BYTE [2] ; + 3 Bytes ;MOV [ES:DI], AL ; + 3 Bytes stosb ; /Upper Line/ + 1 Byte POP CX ; + 1 Byte ADD DX,DI ; + 2 Bytes JMP UX ; + 2 Bytes Is current code.. Last edited by sylwek32 on 26 Oct 2006, 11:23; edited 2 times in total |
|||
26 Oct 2006, 11:06 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.