Author Topic: Assembly - Small intro  (Read 4951 times)

0 Members and 1 Guest are viewing this topic.

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Assembly - Small intro
« on: May 02, 2006 »
*** From DBF ezboard ****


Quote
rbraz
CBM 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 - Kryton

The asm code is far from fast or optimized, but works fine!

If you're too lazy to compile it :) ** Click Here **


Code: [Select]
;
; --------------
; Kryton Advetro
; --------------
;
; by Rbraz ^ Gravity
; April 2006
;
; Fasm 1.65

org 100h

;-------------VGA mode X - 320x200x256k
mov al,13h
int 10h
push 0a000h ; Vga memory
pop es ;

;-------------Load Palette
mov cl,63
mov bl,126
.pal:
mov dx,3c8h
mov al,bl ;[ col ]
dec bl
out dx,al
inc dx
mov al,0 ;[ r ]
out dx,al
mov al,0 ;[ g ]
out dx,al
mov al,cl ;[ b ]
out dx,al
loop .pal

;-------------Write our text
mov ah,02h
mov bh,00h
mov dx,0308h
int 10h
mov ah,9
mov dx,text
int 21h

Main:

;-------------Wait for vertical retrace
mov dx,03DAh
.wait_for_retrace:
in al,dx
test al,8
jz .wait_for_retrace

;-------------Blur Screen
mov di,16000
mov cx,8000
.blur:
mov eax,[es:di]
cmp eax,40404040h
jle .noblur
sub eax,01010101h
.noblur:
stosd
loop .blur

;-------------Sine wave function
fld [angle]
fadd [one]
fst [angle]
fdiv [twopi]
fsin
fmul [mult]
fadd [ center ]
fistp [y]

.draw:

mov ax,word [y] ; ax = y
mov bx,[x] ; bx = x

;-------------WritePixelFast :)
; vgamemory[x + (y*320)] = color ; bx=x, ax=y, cl=color
imul ax,320
add ax,bx
mov di,ax
mov byte [es:di],126 ; color

;-------------Increments x pos
inc [x]
cmp [x],320
je .lp1
jmp .draw
.lp1:
mov [x],0
; mov [angle],0


;-------------Loop (While not key hit)
mov ah,01
int 16h
jz Main

;-------------Return to text mode
mov al,03h
int 10h

;-------------Exit to DOS
mov ax,4c00h
int 21h

;-------------Some variables
angle dd 0.0
one dd 0.25
mult dd 20.0
center dd 100.0
y dd 0.0
x dw 0
twopi dd 6.2830
text db 'Kryton >> Coming up soon!',24h

Edited by: rbraz at: 11/4/06 18:01

 
Quote
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 :P

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

Quote
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!)
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Assembly - Small intro
« Reply #1 on: May 11, 2006 »
Clever so and so you!
Nice one dude. 8)
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Optimus

  • DBF Aficionado
  • ******
  • Posts: 2456
  • Karma: 128
    • View Profile
    • Optimouse Demo Site
Re: Assembly - Small intro
« Reply #2 on: May 18, 2006 »
Nicey. Not an interesting effect displayed, but that blurry raster was kinda warpy :)

Can't wait for your freebasic demo..
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Assembly - Small intro
« Reply #3 on: May 19, 2006 »
Thanks Optimus, this one was just a little test  ;)
Challenge Trophies Won: