flat assembler
Message board for the users of flat assembler.
Index
> Main > Modified Compos Goto page Previous 1, 2, 3 |
Do you think it is a fair thing to optimize someone's compo, and then add your credit? | |||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||
Total Votes : 21 |
Author |
|
Matrix 11 Oct 2004, 00:18
yeah, i see you have saved 1 byte, but it doesn't exit anymore, because on my computer, ah will not be 0 after in ax,$60
if you look at the first page, that was my problem with snow32. but if you want to be polite, you should check status port bit0, and read if keyboard ready, i used to do it in case of files not size optimized. so take note that just reading or writing ports may hang the device or system. MATRIX |
|||
11 Oct 2004, 00:18 |
|
Matrix 11 Oct 2004, 02:09
Code: ; they are the same in size, but the right side won't exit on esc if ah<>0 ; 5 bytes (7 with int 20h) ; i will not take any responsibility for any hardware damages ; this code can cause ; i recommend using the right side with dec al, however its all right if ah=0 ; MATRIX org 256 mainloop: in ax,$5f ; in al,$60 sahf ; dec ax jnc mainloop ; jnc mainloop int 20h MATRIX |
|||
11 Oct 2004, 02:09 |
|
bubach 12 Oct 2004, 07:32
i think i'll hire you to optimize my os when it's done..
Last edited by bubach on 13 Feb 2012, 14:09; edited 1 time in total |
|||
12 Oct 2004, 07:32 |
|
Madis731 12 Oct 2004, 09:50
Matrix, you could exercise on Menuet kernel source
I've found something like: Code: ;imul ebx, 640*4 ; (y+Ywin)*BytesPerScanLine lea ebx,[5*ebx] ;Madis opt. shl ebx,9 ;shl eax,2 ; (x+Xwin)*BytesPerPixel ;add eax,ebx ;Madis opt. lea eax,[eax*4+ebx] time to time I found code where speed AND code were optimized. The main purpose for me is to get it faster. If the code is smaller as a side-effect, that's fine Code: Hey, check this out: ; mov esi,[0xfe00] ; 'it is safe..' ; shr esi,1 ; sub esi,220 ;???? ; add esi,27 ;The most suprising! ; shl esi,16 ; mov eax,esi ; add eax,[shutdownpos] ; add eax,37 mov esi,[0FE00h] ;Madis opt. sub esi,2*(220-27) ;... shl esi,15 mov eax,[shutdownpos] lea eax,[eax+esi+37] ;... I know that shutdown code is only executed once and the speed nor size is not the most important issues, but as I had nothing to do one day, I tried optimizing these codes the last code optimized 38 vs. 29 bytes 8 vs. 5 codelines meaning 3clock gain on the average of 1 op/cycle on a PIII my code performs 3clocks and leaves µ-op spare when the original code performs 5-6clocks on a PIII |
|||
12 Oct 2004, 09:50 |
|
Matrix 12 Oct 2004, 14:03
YEAH THAT'S NICE if i have nothing to do i will take a look. in many cases you can optimize algorithms, loops, and in addition you can try smaller/faster opcodes. MATRIX |
|||
12 Oct 2004, 14:03 |
|
Matrix 02 Dec 2004, 01:34
linking to 256 byte TETRIS
@ heap |
|||
02 Dec 2004, 01:34 |
|
Goto page Previous 1, 2, 3 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.