• Welcome to Dark Bit Factory & Gravity.
 

colours in mode 13h

Started by rain_storm, February 12, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Jim

That's right, under VGA/MCGA you only have 6bit colour guns, so 262144 colours instead of the present day 16.7million.  Means there are only 64 shades of red.

Jim
Challenge Trophies Won:

Clanky

Wow! What's ASM!?
Seem's like an impossible language eeeeee  ???
Don't think I'll be starting this one! lol
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..

Jim

Assembler - mostly the code posted here is Intel x86 assembler, which is written in mnemonics (assembler instructions) and assembled directly to machine code.  There's no high level language stuff, just the basic instructions for moving data around, processing it, and access directly to the CPU registers.  It's a lot of fun, and every CPU from every manufacturer is different!

Jim
Challenge Trophies Won:

Shockwave

Clanky, if you want to see what can be done in asm, go over to intro-inferno and search for productions from a group called wamma
There's a guy called Yobi who codes some of the most amazing low byte stuff you've ever seen! Honestly, you would not believe the effects you can do in 256 bytes!!
Typically asm instruction sets are not so bad to learn, for a start, there are far fewer commands to worry about and on the pc, you just use them to do the stuff that jim says.. You can also invoke interrupts to open screens etc..


mov al,13h <-- That just puts the desired gfx mode into the register al
int 10h <-- Initialise the video mode


There are several registers, you can think of them like variables, and you can store memory addresses in them or data and perform operations on that data exactly the same as you would in basic, only the command set is different.

Assembly language was developed a long time ago to help programmers write programs for the first computers.. Originally all programs were written in binary on punch cards, assembly language (because of it's limited command list and simple commands) is very easily translatable into machine code that the computer understands. It's cool to use, very powerful and produces extremely efficient programs!
Shockwave ^ Codigos
Challenge Trophies Won:

Agent Smith

Out of curiosity, why do you guys still use 16-bit real mode (with BIOS interrupts etc) for your assembly language stuff?  ???

Is it just because it's easier, or because of like the 'retro' appeal?

Shockwave

Because mode 13 is the best mode for 256 colour tiny intros. You can make intros that are even smaller than 256 bytes, sometimes there are even 64 byte or 32 byte intros released.
Shockwave ^ Codigos
Challenge Trophies Won:

rain_storm

Also 16-bit x86 (DOS) assembler is the most documented form of assembler so its a good variant to cut your teeth on MASM32 and other 32 bit assemblers expect that the programmer is not new to the language and so the basics are not covered in a way that suits learnin the stuff with no experience. And you can thank Ralf Brown for making 16-bit DOS so accessable to the masses

Challenge Trophies Won:

Agent Smith

Thanks. I see, so it's all about optimizing for size over speed. I'd never actually heard of Ralf Brown until I just googled  :-\
But is there an actual requirement for such micro-sized executables, or is it just about the hacker kudos to see who can shave off maximum bytes?

I mean, I could understand it if the target platform had only a couple of k of RAM installed, but for a modern PC with a couple of G's and a 32/64-bit OS?   ???
Please forgive my ignorance about the demo/intro scene - and don't get me wrong, I'm not trying to knock it or anything. I really admire what you guys do, just tryin' to understand the motivation behind it.

Shockwave

Here's some research for you :)

WAMMA

These are all 256b dos intros in pure assembler using 13h. (some of them you may have to quit using alt and tab as the coder tries to squeeze as much into 256b as possible), this is a demo making forum, not a games place so it's understandable that games coders can have some trouble understanding the motivation.. But if you check out those intros by Wamma you will either get it or not.

For me, and most of the people here they are art.
Shockwave ^ Codigos
Challenge Trophies Won:

Shockwave

Whoops.

Just type wamma into the search box on the page that comes up :)
Shockwave ^ Codigos
Challenge Trophies Won:

Agent Smith

#30
Thanks for the link, and also for taking the time to enlighten this ignorant peasant - yes, the penny has dropped and I can certainly relate to the 'minimalist art' thing. In one sense this is programming in it's purest form.

I have to confess that I previously visited here solely out of interest in the general applicability of the programming techniques discussed, but you may have made a convert out of me  ;)

Time to dust off my old DOS-era assembly skills and have a crack at some of this good stuff myself!  :)

rain_storm

Thats a mighty fine collection of tiny code there here is also a good site they deal exclusively in 256b and some 32b/64b

http://www.256b.com/home.php

Challenge Trophies Won: