programmers resources
  http://www.intel-assembler.it/  (c)2017 intel-assembler.it   info@intel-assembler.it
 
Search :  
Lingua Italiana    English Language   
Index
 
just an empty assembly space
just an arrow Intel Platform
just an arrow Article & Guides
just an arrow Download Software


23/01/2009 Featured Article: How to remove Buzus Virus (permalink)




:::3058363:::
Bottone Scambio Directory Pubblicitaonline.it
Home Page | Articles & Guides | Download | Intel Platform | Contacts

Google
 


Bookmark and Share
Download 
Tell a friend



4K 3D Asm Demo

4096 byte 3D assembler graphical demo

(by jari kytöjoki)

Lovely 4KB demo written in assembly. An example of how to write very compact code. This demo was presented at Assembly '94 event. The source code is 83KB and the compiled version is available in the zip file ready to run in DOS mode.
This article is online from 2698 days and has been seen 10179 times




;+-----------------------------------------------------------------------------+
;! Filename:    GIANT.ASM                                                      !
;+-----------------------------------------------------------------------------+
;! Source Codes for GIANT. The Ultimate 4KB-Intro! [:)] v. 1.1                 !
;!                                                                             !
;! Written by:  Sigma of Star Team Productions, (+, STP)                       !
;!              alias Jari Kytöjoki                                            !
;!                                                                             !
;! Snail-Mail:  Jari Kytöjoki                                                  !
;!              Puolukkakatu 5                                                 !
;!              44200 Suolahti                                                 !
;!              Finland, Europe, Earth                                         !
;!                                                                             !
;! E-Mail:      jari.kytojoki@hut.fi                                           !
;!                                                                             !
;! Please, send me a Postcard!!!                                               !
;! Send me your source codes! (or at least some technical info, etc...) ;)     !
;! Don't hesitate to contact me!                                               !
;!                                                                             !
;! Copyright (C) 1994, 1995 Jari Kyt”joki. All Rights Reserved.                !
;+-----------------------------------------------------------------------------+
;       After many inquiries for sources I decided to release this
;       source code. It is released as public domain. You can do it
;       whatever you want or like. But remember, if you are just
;       planning to make a new intro only by adding, removing or any
;       other way changing a few lines of this code, you are entering
;       worldwide lamers' club. But if you are reading this file just
;       because you want to learn something new, go on it! This is
;       the most biggest reason why I released this code. However,
;       I cannot promise there's anything new that you haven't known
;       before. (It's always worth studying new sources...) If you find
;       this file very helpful, please send me a postcard or at least
;       write me some E-Mail.
;--------------------------------------------------------------------------+
;       You can compile this file with TASM, I included MAKE.BAT
;       to help you. You'll notice that resulting COM-file will be
;       much larger than the released version. This is due to
;       the original COM-file has been compressed to fit in those
;       specified limits. If you are just compiling, testing and
;       debugging this source file there's no harm of it. You'll
;       have to compress the COM-file with your own compressor if
;       you want the new COM-file to be as small as the original
;       one. ;-)
;--------------------------------------------------------------------------+
;       The code was optimized mainly for size and some parts seem to
;       be coded quite weirdly. In some time critical parts I repeated
;       the source code and I trusted the compressor would do the rest,
;       so that the file would be less than 4KB. There is still some
;       "extra" dummy bytes which could easily be removed.
;         My opinion of making a small intro is not hard. I had quite a
;       many ideas to put in this intro within the limits I had set, but
;       soon all 4KB was used and I had to think all over again. Many of
;       my plans finished undone. The size limit was reached too quickly.
;         I hope you enjoy my intro and learn something new.
;
;Last words: I'm sorry there isn't too many comments in this file.
;            Just try to figure it out.
;--------------------------------------------------------------------------+

Code    Segment Para Public use16 'Code'

        .386
        .387
        Jumps

        Assume  cs:Code, ds:Code, es:Code, ss:Code, fs:Code, gs:Code

        Temp0           Equ     word ptr ds:10A2h
        Temp1           Equ     word ptr ds:10A4h
        Temp2           Equ     word ptr ds:10A6h
        Temp4           Equ     word ptr ds:0100h
        Sin2T           Equ     word ptr ds:0D000h
        Cos2T           Equ     word ptr ds:0D200h
        SinT            Equ     word ptr ds:0E000h
        CosT            Equ     word ptr ds:0E200h
        Temp_PAL3       Equ     word ptr 0DF00h
        Temp_PAL2       Equ     word ptr 0DC00h
        Temp_PAL1       Equ     word ptr 0EC00h
        Row256T         Equ     word ptr ds:0CE00h
        CharP           Equ     word ptr ds:0106h
        CharColor       Equ     word ptr ds:010Ah
        TextSeg         =       Temp0
        XMin            Equ     word ptr ds:010Ch
        YMax            Equ     word ptr ds:010Eh
        XStep           Equ     word ptr ds:0110h
        YStep           Equ     word ptr ds:0112h
        ScreenX         Equ     word ptr ds:0114h
        ScreenY         Equ     word ptr ds:0116h
        NMax            Equ     word ptr ds:0118h
        x               Equ     word ptr ds:011Ah
        y               Equ     word ptr ds:011Ch
        zi              Equ     word ptr ds:011Eh
        zr              Equ     word ptr ds:0120h
        cr              Equ     word ptr ds:0122h
        ci              Equ     word ptr ds:0124h
        d2x             =       zi
        d2y             =       zr
        i               =       ScreenX
        j               =       ScreenY
        TempPAL1        Equ     word ptr 0E000h
        TempPAL2        Equ     word ptr 0E400h


M_WaitVRT       Macro
                Local   @@wv1, @@wv2
  @@wv1:
                        in      al, dx
                        test    al, 8
                        jz      @@wv1
  @@wv2:
                        in      al, dx
                        test    al, 8
                        jnz     @@wv2
                EndM

M_WaitVRT_DX    Macro
                        mov     dx, 03DAh
                        M_WaitVRT
                EndM

M_FadePAL_Out   Macro   SourcePAL, DestPAL
                Local   @@fo1, @@fo2
                        mov     bx, 0200h
  @@fo1:
                        mov     si, SourcePAL
                        mov     di, DestPAL
                        mov     cx, 3*256
  @@fo2:
                        lodsb
                        sub     al, bl
                        cmc
                        sbb     ah, ah
                        and     al, ah
                        stosb
                        loop    @@fo2
                        mov     si, DestPAL
                        mov     cx, 3*256
                        mov     dx, 03DAh
                        M_WaitVRT_DX
                        mov     dx, 03C8h
                        mov     al, 00h
                        out     dx, al
                        inc     dx
                        rep     outsb
                        mov     dx, 03DAh
                        M_WaitVRT_DX
                        add     bl, bh
                        test    bl, 3Fh
                        jnz     @@fo1
                EndM


(*** download for full code ***)




Top
Download 
Tell a friend
Bookmark and Share



Similar Articles

2D/3D Rotation asm demos
Source code for 2D and 3D rotation
(by Ash [NLB/BD])

3D Rotating Cube Assembler source
An improved asm code for 3d graphics
(by Arno W. Brouwer)

3D Texture Mapping theory and asm code
a mid-length text about texture logic and coding
(by Sean Barrett)

Basic Introduction to 3D Programming
A short doc about howto plot in 3D
(by Synergist)

Math.inc: General 3D math functions
A library with many math functions for 3d graphics
(by John McCarthy)

Perspective Transforms
A two page document with the perspective formulas
(by Andre Yew)

REFRACTION 4k intro
Assembler graphic demo, 3D chessboard
(by G.O.D.)

Star Field
3D Assembly star field
(by VLA)

Three Dimensional Rotations For Computer Graphics
A short document on 3D rotation
(by VLA)

Three Dimensional Shading In Computer Graphics
A brief intro on 3d shading theory
(by VLA)

VGA Trainer Program
A course for graphic programming in Pascal/ASM
(by Grant Smith Denthor of ASPHYXIA)

VGOPHONG Phong lighting and specular highlights
Theory, practice of phong lightnin and shade model
(by TimJ/Vertigo)

X-Sharp 3-D animation package v22
3D ball demo with zoom, share and move
(by Michael Abrash)

Zed3D programming guide
A compact reference for 3d computer graphics
(by Sébastien Loisel)

 Tags: 3d, asm graph demo


webmaster jes
writers rguru, tech-g, aiguru, drAx

site optimized for IE/Firefox/Chrome with 1024x768 resolution

Valid HTML 4.01 Transitional


ALL TRADEMARKS ® ARE PROPERTY OF LEGITTIMATE OWNERS.
© ALL RIGHTS RESERVED.

hosting&web - www.accademia3.it

grossocactus
find rguru on
http://www.twitter.com/sicurezza3/
... send an email ...
Your name

Destination email

Message

captcha! Code