0 Members and 1 Guest are viewing this topic.
rbrazCBM 128 Posts: 162(11/4/06 17:23)Reply | Edit  Assembly - Small intro-------------------------------------------------------------------------------- Here a little advertro released for the fun of it, and to announce our up-coming FB demo called - KrytonThe asm code is far from fast or optimized, but works fine!If you're too lazy to compile it ** Click Here **
;; --------------; Kryton Advetro; --------------;; by Rbraz ^ Gravity; April 2006;; Fasm 1.65org 100h;-------------VGA mode X - 320x200x256kmov al,13hint 10hpush 0a000h ; Vga memorypop es ;;-------------Load Palettemov cl,63mov bl,126.pal:mov dx,3c8hmov al,bl ;[ col ]dec blout dx,alinc dxmov al,0 ;[ r ]out dx,almov al,0 ;[ g ]out dx,almov al,cl ;[ b ]out dx,alloop .pal;-------------Write our textmov ah,02hmov bh,00hmov dx,0308hint 10hmov ah,9mov dx,textint 21hMain:;-------------Wait for vertical retracemov dx,03DAh.wait_for_retrace:in al,dxtest al,8jz .wait_for_retrace;-------------Blur Screenmov di,16000mov cx,8000.blur:mov eax,[es:di]cmp eax,40404040hjle .noblursub eax,01010101h.noblur:stosdloop .blur;-------------Sine wave functionfld [angle]fadd [one]fst [angle]fdiv [twopi]fsinfmul [mult]fadd [ center ]fistp [y].draw:mov ax,word [y] ; ax = ymov bx,[x] ; bx = x;-------------WritePixelFast :); vgamemory[x + (y*320)] = color ; bx=x, ax=y, cl=colorimul ax,320add ax,bxmov di,axmov byte [es:di],126 ; color;-------------Increments x posinc [x]cmp [x],320je .lp1jmp .draw.lp1:mov [x],0; mov [angle],0;-------------Loop (While not key hit)mov ah,01int 16hjz Main;-------------Return to text modemov al,03hint 10h;-------------Exit to DOSmov ax,4c00hint 21h;-------------Some variablesangle dd 0.0one dd 0.25mult dd 20.0center dd 100.0y dd 0.0x dw 0twopi dd 6.2830text db 'Kryton >> Coming up soon!',24hEdited by: rbraz at: 11/4/06 18:01
Thygrion DBF: Coder Posts: 361(12/4/06 1:13)Reply  Re: Assembly - Small intro-------------------------------------------------------------------------------- Kryton's gonna kick some serious ass when it's done - trust me, I did the music Also BTW a "mov bh,00h" could be replaced by an "xor bh,bh" to save a byte or two --------------------------------------------------------------------------------Finally 14!!Edited by: Thygrion  at: 12/4/06 1:14
5H0CKW4VE *Administrator* Posts: 7973(12/4/06 16:52)Reply ezSupporter Re: Assembly - Small intro-------------------------------------------------------------------------------- FFS, 220 bytes! Nice 'n tiny!Works fine here. --------------------------------------------------------------------------------¤´¨)¸.·´¸.·*´¨) ¸.·*¨)(¸.·´ (¸.·`¤... SHOCKWAVE / DBF...¤VISIT DARK BIT FACTORY INTERACTIVE! (please!)