How to create simple graphics using ASM - Help !

I'm relatively new to assembly. I want to create graphics using the
video memory(B8000) directly. i've been able to create graphics using a
blank character with a coloured background in 80x25 mode.
1)  Whats the memory scheme if I increase trhe resolution ?
2) Will I be able to print text(at same size) if I choose a higher
resolution mode (say, using  int2h)?
3)Any good sites where i can find more resources on this subject

0
spamtrap2 (1627)
1/28/2006 1:35:25 AM
comp.lang.asm.x86 4917 articles. 11 followers. Post Follow

5 Replies
289 Views

Similar Articles

[PageSpeed] 19
Hello ....?

spamtrap@crayne.org schrieb:
> I'm relatively new to assembly. I want to create graphics using the
> video memory(B8000) directly. i've been able to create graphics using a
> blank character with a coloured background in 80x25 mode.

Do you want graphics on a text mode, by modifying the chars of the ASCIIs?

> 1)  Whats the memory scheme if I increase trhe resolution ?

The memory adress of graphicmodi is a 64K-bank in A0000
and for linear vesamodi(vesa.org) the adress vary in the 4th GB.

The scheme of the memory, vary by mode of 8/16/24/32-bit color.
For 8 bit-color(256) every byte represents a pixel.

> 2) Will I be able to print text(at same size) if I choose a higher
> resolution mode (say, using  int2h)?

DOS-int 21h?

Many graphic cards also provide text stdout to some graphicmodi.

Dirk

0
Dirk
1/28/2006 6:15:08 AM
hi,
spamtrap@crayne.org wrote:
> I'm relatively new to assembly. I want to create graphics using the
> video memory(B8000) directly. i've been able to create graphics using a
> blank character with a coloured background in 80x25 mode.
> 1)  Whats the memory scheme if I increase trhe resolution ?
> 2) Will I be able to print text(at same size) if I choose a higher
> resolution mode (say, using  int2h)?
> 3)Any good sites where i can find more resources on this subject

search for michel abrash. zen of graphics programming.

0
Das
1/28/2006 3:47:38 PM
spamtrap@crayne.org wrote:
>
>I'm relatively new to assembly. I want to create graphics using the
>video memory(B8000) directly. i've been able to create graphics using a
>blank character with a coloured background in 80x25 mode.
>1)  Whats the memory scheme if I increase trhe resolution ?

There are only a few valid text modes.  To the best of my knowledge, a text
mode can either be 80 wide or 132 wide.  In either case, characters in a
VGA text mode are stored linearly.  The character and attribute for the
first character in row N immediately followed the last character in row
N-1.  So, if you have a 132x40 text mode, the first character of the second
row will be at offset 264 (decimal -- remember 2 bytes per character).

>2) Will I be able to print text(at same size) if I choose a higher
>resolution mode (say, using  int2h)?

I'm not sure what you are trying to say.  The benefit of using a higher
resolution is that you can use smaller characters, and hence fit more of
them on the screen.
-- 
- Tim Roberts, timr@probo.com
  Providenza & Boekelheide, Inc.

0
Tim
1/30/2006 2:48:28 AM
On Mon, 30 Jan 2006 02:48:28 GMT, Tim Roberts  <spamtrap@crayne.org>
wrote:

<snip>
>There are only a few valid text modes.  To the best of my knowledge, a text
>mode can either be 80 wide or 132 wide.  
Usual standard modes, normally, yes.  But, there is no reason that one
could not just reprogram the vga card to get whatever size you want.
You do have to know how to do that, which I don't.  There are times
where a 90x25 or 100x30 would be useful.

<snip>

-- 
ArarghMail601 at [drop the 'http://www.' from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html

To reply by email, remove the garbage from the reply address.

0
spamtrap
1/30/2006 4:39:17 AM
spamtrap@crayne.org wrote:
> On Mon, 30 Jan 2006 02:48:28 GMT, Tim Roberts  <spamtrap@crayne.org>
> wrote:
>
> <snip>
> >There are only a few valid text modes.  To the best of my knowledge, a text
> >mode can either be 80 wide or 132 wide.
> Usual standard modes, normally, yes.  But, there is no reason that one
> could not just reprogram the vga card to get whatever size you want.
> You do have to know how to do that, which I don't.  There are times
> where a 90x25 or 100x30 would be useful.
>
> <snip>
>
> --
> ArarghMail601 at [drop the 'http://www.' from ->] http://www.arargh.com
> BCET Basic Compiler Page: http://www.arargh.com/basic/index.html
>
> To reply by email, remove the garbage from the reply address.

You could write all your own stuff in a graphics mode?

[BITS 16]
[ORG 0x0100]

[SEGMENT .data]
coords	times 480 dw 0
window	times 480 db 0
task	db    10
vinfo	times 255 db 0

[SEGMENT .text]
main:
;set up LUT tables and initialize vesa
    call define_coords
    call define_window
    call initvesa
    mov ax,0        ; color
next_color:
    push ax         ; save current color
    mov dx,0        ; y coord
y_loop:
    mov bx,0        ; x coord
x_loop:
    call putpixel
    inc bx
    cmp bx,640
    jnz x_loop
    inc dx
    cmp dx,480
    jnz y_loop

    mov ah,07h         ;wait keypress
    int 21h

    pop ax            ;get color
    inc ax            ;next color
    cmp ax,16         ;all done?
    jnz next_color

    mov ax,0003h
    int 10h
    mov ax,4c00h
    int 21h
;==== END OF MAIN PROGRAM =======  ; main  endp

initvesa:
;************************************
    push ds
    pop es
    lea di,[vinfo]
    mov cx,0101h
    mov ax,4f01h
    int 10h
;***************************************
    mov ax,4f02h
    mov bx,101h
    int 10h
    mov ax,0a000h
    mov es,ax
    ret
;end initvesa

define_coords:
    xor cx,cx
    xor si,si
again_def_c:
    mov ax,640
    xor dx,dx
    mul cx
    mov [coords+si],ax
    inc si
    inc si
    inc cx
    cmp cx,480
    jb again_def_c
    ret
;end of define_coords

define_window:
    xor si,si
    xor ax,ax
def_w1:
    mov [window+si],al
    inc si
    cmp si,102
    jbe def_w1
    mov al,1
def_w2:
    mov [window+si],al
    inc si
    cmp si,204
    jbe def_w2
    mov al,2
def_w3:
    mov [window+si],al
    inc si
    cmp si,307
    jbe def_w3
    mov al,3
def_w4:
    mov [window+si],al
    inc si
    cmp si,409
    jbe def_w4
    mov al,4
def_w5:
    mov [window+si],al
    inc si
    cmp si,480
    jb def_w5
fine:
    ret
;end of define window

putpixel:
;bx=x dx=y al=col
    push dx
    push bx
    push ax
    mov si,dx
    mov dl,[window+si]
    add si,si
    mov di,[coords+si]
    add di,bx
    adc dl,0
avanti1:
    cmp dl,[task]
    je avanti2
    mov [task],dl
    push ax
    xor bx,bx
;***************************************************
    call far [vinfo+0ch]
;****************************************************
    pop ax
avanti2:
    mov [es:di],al
    pop ax
    pop bx
    pop dx
    ret
;end of putpixel

;end of main

0
JGCASEY
1/31/2006 10:35:41 PM
Reply:
Similar Artilces:

Using Skill Expressions/Skill Variables in a Unix Command
Hi, How do I use Skill Variables / Skill Expressions in a Unix Command ?? In my skill code I m trying to execute mailx command by using system command. I want to get the Inputs such as the Subject of the mail, cc list and the user id from a form. I tried passing the form field inputs to the system(mailx ....) command in the below 2 ways. 1) The Below syntax fails as the arguments to the mailx are skill expressions. system("mailx -s formName->subFieldName->value -c formName- >cclistFieldName->value formName->mailidFieldName->value < file_path") 2) I tried ass...

Create/Exception then Destruct
Hi Folks, I have a question about the process of constructing and destructing objects when an exception happens in the constructor. the doc says: ----- When an exception is raised during creation of an object, Destroy is automatically called to dispose of the unfinished object. This means that Destroy must be prepared to dispose of partially constructed objects. Because a constructor sets the fields of a new object to zero or empty values before performing other actions, class-type and pointer-type fields in a partially constructed object are always nil. ----- Is that REALL...

Newbie in creating the fonts.
Hi. I'm a newbie of creating and editing fonts. Now I'm trying program: FontLab. It's great but All this concepts (terms, poperties) which's connected with fonts are a little incomprehensible. For example: glyphs, outlines, hints. Could You please to explain me what are these? Kind regards. -- pozdroovka. Zebik Glyphs are the individual letters. Outlines are just what it sounds like. When you draw a letter you do it just as you would with pen and paper by making the basic shape...the computer colours the inside of the shape when you use the font. Hints are what the ...

creating objects type only known at runtime
This weekend I was playing around with some ruby and wanted to create objects whose types were only known at runtime. The method I wound up using was o = eval "#{class_name}.new" Is this a preferred method. I come from (mostly) a perl background, but also a Java background. To me this approach seems inelegant. Thanks for any input. Andy -- Andrew Libby Tangeis, LLC Innovative IT Management Solutions alibby@tangeis.com On 23/10/06, Andrew Libby <alibby@tangeis.com> wrote: > > This weekend I was playing around with some ruby and wanted > to create objects ...

Re: Tracking what .sas file created a dataset? #3
You could add the source file to the dataset label... -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Scott D. Sent: Friday, January 12, 2007 1:33 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Tracking what .sas file created a dataset? Is there an automatic way to do know what file created a particular dataset? Say I create a dataset and store it in a library, and I later want to access this dataset but don't remember what .sas file created it. Of course I can grep *.sas, but I want to keep this information with the dataset. Any ideas here would ...

[News] Raytheon's Use of Linux Hits the Press
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Raytheon unveils Linux 'Insider Threat' rooter-out routers ,----[ Quote ] | US armstech mammoth Raytheon has announced that | its "government insider threat management | solution" for information security will be | powered by Linux. Penguin-inside crypto modules | to be used in Raytheon's mole-buster tech have | now passed tough federal security validation, | apparently. `---- http://www.theregister.co.uk/2009/10/22/insider_threat_linux_powered/ Raytheon Insider Threat Solution receives federal validation ,----[ Quo...

how to create virtual domain with webmin ?
Dear list, I had PLESK 7.5 on a remote server and I used to create domains with plesk . I could also access those domain from internet. Due to the lincese expiration I have discontinue with Plesk and installed webmin. So is it possible to create domain with webmin which can be accessed from internet ? thanks. ...

Why use a symbol in place of a variable?
Hi, Say you have a method in a class that's defined as this: (working from Peter Cooper's Beginning Ruby book, p. 155 of the book) class Dungeon A symbol and a variable are two different things. A symbol is essentially a special kind of literal, just like a number or a string is. You cannot assign values to symbols, just like you can't assign values to numbers or strings -- they are their own values. That is, it makes no sense to say `42 = "banana"`, just as it makes no sense to say `:banana = 42`. In this case, the author is using the symbol :largecave to represent a ...

sequence 3 tasks
Hello &nbsp; i use a board 6023E and pc pentium4 3Ghz &nbsp; My problem is how create a delay with few microseconds between two tasks? &nbsp; I need creat three tasks. Fisrt create a finte pulse train for this i use a counter. Second create a delay for this i use again a conter to creat a pulse train in witch the delay is equal to frequency x number of pulses. Third measure pulses for this i use again a counter but in this case is a counter input. In attachment i send a picture with my program. &nbsp; I dont understand&nbsp;why my program dont work? my program take a lote ...

can not create directories like adump etc
I was trying to create a database instance using DBCA in 10G. After selecting all parameters, small window pops up and says cannot create adump directory. Do I have to create all these directory manually before I run DBCA or what. I am running dbca from oracle login account. It's pretty much giving the same error like cannot create some directories or some files for everything it's supposed to create atutomatically. I am able to create mannually all these directories but why DBCA can't create these automatically otherwise no point in creating database through DBCA. Am I ...

Q: Create a console for a GUI app
Hi! I want to create a console for a GUI application. I am using AllocConsole, which also works as expected. But then I still cannot use printf etc to write to the console, even though the documentation for AllocConsole tells me "AllocConsole initializes standard input, standard output, and standard error handles for the new console.". So what am I missing? Thanks in advance! -- jb (replace y with x if you want to reply by e-mail) "cfx" <u.t.o@wanadoo.fr> wrote in message news:bf36o3$khl$1@news-sop.inria.fr... > "Jakob Bieling&quo...

How to launch an application on a remote computer using Python
I have 2 computers hooked to the same network. One of the computer has Python installed, and I want to write a python script to launch "c:\notepad.exe" on the second computer, how do I do this? (Note: Python is not installed on the second computer) Thanks. ...

How to Create an Uninstall?
Hi, How can I get Windows to recognize an installed app so the user can uninstall it through the Control Panel? I'm not using MSIE, InstallShield, or any other off the shelf product, but a home-brewed installation program written in VC++ 6.0. Thanks. xmp333@yahoo.com wrote: > How can I get Windows to recognize an installed app so the user can > uninstall it through the Control Panel? Rather that re-inventing the wheel, I suggest taking a look at the Inno Setup program: http://www.jrsoftware.org/isinfo.htm Not only is it a fantastic installer it ...

simple FORMAT question for the experts
Hi, I know this is a simple question for some, but for me who has not yet become a master in formatting syntax I can't seem to get it right. I am outputting a large number of files and on one line of those files, I output a list of string values. The challenging part is that for each file the list changes so the number of elements with a comma separating each one and I would like to have one consistent format string (if possible). I know I can combine strings with the number of elements of the array but prefer not to go that route. Here is a sample: array = ['a','b',&#...

Dragging text to create a file?
I thought that there was a way to drag text off of a document or web page and drop it on a finder window to create a file. Something is created by the finder, but it is not the kind of file I was anticipating. Is there some way to do this?? I am hoping for something like the OS/2 WPS Drag Text SOM Class that would just extend the Finder. Thanks in advance, -- John Holt John Holt <jdholt77_evomer@remove_earthlink.net> wrote: > I thought that there was a way to drag text off of a document or web > page and drop it on a finder window to create a file. Something is >...

Number of units in use
Ok, so I know the LUVU command will list units unused, but is there a similar command to list units used? We rae trying to get a number on the digital and analog lines we have in use. -- Kendal Emery MCNGP #19 Now living in the great state of Colorado Permament resident of the State of Confusion Depending on which software version you are running you could invoke a set inventory command from LD 117. >LD 117 <-- Go into load 117. OAM000 MEM AVAIL: (U/P): 785032 USED U P: 294827 83404 TOT: 1163263 DISK RECS AVAIL: 392 SURVIVABILITY AVAIL: 0 USED: ...

Create Subsystem command
Hi, is there any way to perform an "pre create subsystem" funktion or script? Means clicking on the "Create Subsystem" Button first executes a script and then Draws the Subsystem. Or is there a commandline command that creates a subsystem from the selected blocks and lines? Thanks in advance Nils ...

How to serialize reference members using boost::serialization
The subject line explains it well enough. I am not quite clear about how to approach it as there isn't any sample code that explains it. Const members and no default constructors are fine, I can deal with them and in fact const members without a const_cast<> but how about references? Can anyone provide me some directions? Thanks in advance! -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] On 27 Feb, 14:06, "Abhishek Padmanabh" <abhishek.padman...@gmail.com> wrote: > The sub...

Re: Problem using output statement to disaggregate dataset #2
Here is one implementation: data Original; input GENERIC_NAME $ 1-21 VARA $ VARB $ VARC $; datalines; ABACAVIR / LAMIVUDINE X Y Z ; data Revises(drop=temp); set Original; temp=GENERIC_NAME; do until (index(temp,"/") eq 0); GENERIC_NAME=compress(substr(temp,1,index(temp,"/")-1)); output; temp=substr(temp,index(temp,"/")+1); end; GENERIC_NAME=compress(substr(temp,1,index(temp,"/")-1)); output; RUN; proc print; run; ***** Output ***** The SAS System 06:20 Thursday, February ...

3d graphics
Hi, I'm interested in doing some work with 3d graphics visualizations of XML/RDF data in Python. I know Python is strong on the XML front but what about 3d graphics? Is there a graphics library out there with graphics library with a fairly gradual learning curve? Do people actually use Python for games programming and the likes? Thanks, Eric ...

Noob: Creating (create)
I'm playing with win32forth, trying to figure out how I could make the word (create) which would work inside a colon definition. So I could do: : makeit (create) foo 1 cell allot ; I'm figuring that (create) must be an immediate word - the problem is how to look ahead to get the foo. What's the answer? Mark Carter wrote: > I'm playing with win32forth, trying to figure out how I could make the > word (create) which would work inside a colon definition. So I could do: > : makeit (create) foo 1 cell allot ; > > I'm figuring that (create) must be an immedi...

Tools for creating Draw files
For a work project I may need to find a way of drawing vector art in a turnkey, embedded system. Given that I'm going to have to write all this code myself, I'm rather attracted to the idea of using Acorn drawfiles as the file format --- they're simple, reasonably compact, and dead easy to parse. However, I still need some way of creating them. Does anyone know of any tools for converting, say, SVG to !Draw, or something similar? This is most likely going to have to run on a Unix-oid command line system, so I won't be able to use anything RISC OS-based, alas. -- David Given...

MySQL
The other day, for unfathomable reasons, I lost control over tables which I create. There was no concurrent change of anything on the machine, such as an update. So I have no suspect. Does the following action log suggest any recommendation to experienced SQL programmers? 1. A table: mysql> select * from expenses; +----+------------+-------+----------+--------+-------------+-------+ | id | date | place | stuff | amount | category | flags | +----+------------+-------+----------+--------+-------------+-------+ | 38 | 2013-01-15 | ATT | Sim card | 25.00 | Visa...

how to build a cluster using PS3
Hi all, I need your advice/suggestions on which system to choose/purchase/build in order to do high performance computations. The software I mostly rely on are: Matlab, Mathematica, Maple, C/C++, GSL, GMP, MPFR, etc. The area of computations are numerical computation, symbolic computation, numerical optimization(about mid size). I am looking for cost-effective solutions using my own money as a student and this is not officially supported by any grant. Somebody suggested me to try building a cluster using PS3. I heard that it costs lower and has better performance in terms of floating po...

jdbc driver not found in simple java program for personal Oracle
I am trying to write a small application to connect to an Oracle database in Windows XP. i try the following code: Class d = Class.forName("persoracle.jdbc.oracle.jdbc.driver.OracleDriver"); System.out.println("Loaded " + d); and i get the following error from my println: java.lang.ClassNotFoundException: persoracle.jdbc.oracle.jdbc.driver.OracleDriver I am using personal oracle and i have tried oracle.jdbc.driver.OracleDriver.I see the OracleDriver class in the persoracle\jdbc\oracle\jdbc\driver folder. I also see some zip and jar files in persoracle...