How to create simple graphics using ASM - Help !

  • Permalink
  • submit to reddit
  • Email
  • Follow


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
Reply spamtrap2 (1627) 1/28/2006 1:35:25 AM

See related articles to this posting

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
Reply 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
Reply 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
Reply 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
Reply 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
Reply JGCASEY 1/31/2006 10:35:41 PM
comp.lang.asm.x86 4837 articles. 10 followers. Post

5 Replies
181 Views

Similar Articles

[PageSpeed] 19

  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

GUIDE: Using xtopdf to create PDF from text and DBF files (including creating simple PDF e-books)
Hi, I'm giving below, steps to install and use my xtopdf PDF creation/conversion toolkit. This post is for end-users. xtopdf is both a set of end-user tools and a library for use by developers, to create PDF from various input formats. I'll post another message here about how developers can use it in various ways, sometime later. The steps are for the Windows platform. Will do another post for Linux. 1. Get Python v2.4.3 here: http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi Size is not more than 10 MB. Install it - its an MSI, so just double-click. (Any Python version >...

GUIDE: Using xtopdf to create PDF from text and DBF files (including creating simple PDF e-books)
Hi, I'm giving below, steps to install and use my xtopdf PDF creation/conversion toolkit. This post is for end-users. xtopdf is both a set of end-user tools and a library for use by developers, to create PDF from various input formats. I'll post another message here about how developers can use it in various ways, sometime later. The steps are for the Windows platform. Will do another post for Linux. 1. Get Python v2.4.3 here: http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi Size is not more than 10 MB. Install it - its an MSI, so just double-click. (Any Python version >...

Creating simple, probabilistic graphics
Hi, I'm relatively new to creating graphics in matlab, and wanted to know if someone had an idea how to do the following: I have two vectors x and y. Each element of x is a probability, say .3, and the correspoding element in y is the complement of that probability, say .7. I need to create a graphic for each observation which is a square that is blue and red, where the blue area is proportional to the x probability and the y area is proportional to the Y probability. So for instance, I have a square, which is divided into 2 rectangles where the upper 30% is blue, and the lower 70% is ...

creating Graphics using ParallelTable[]
Hello all, I generate "video frames" from time-consuming 3DPlot[]s (to export them into a video file later on): frame[x_] := Plot3D[... something big using x ...]; movieframes = Table[frame[x], {x, start, end, (end-start)/steps}]; I have a double core CPU; so now I would like to create these frames in parallel with Mathematica 7, using ParallelTable[]. But I don't derive any advantage from doing this: My Windows taskmanager shows three "MathKernel.exe". When I use ParallelTable[] for the described problem, only one "MathKernel.exe" is working...

A simple to use graphic library ?
Hello, I am looking for a simple graphics library which I can suggest to students of mine who are not very experienced programmers. The aim is to graph a curve from a set of (x(t),y(t)) data, along time (e.g. one point each second). Therefore I cannot use gnuplot :-) I am looking for something such as the Borland Graphics library, which was very simple to use. Any suggestion ? -- Cordialement Dominique MICOLLET Email : enlevez le .fr.fr Universite de Bourgogne 9, Avenue Alain SAVARY BP 47870 Tel : +33/(0)3-80-39-59-27 21078 DIJON CEDEX ...

create arrays graphically using charts
I want to create an output signal from my DAQcard to a proportional pressure regulator. can I use Labview to manipulate the output array by dragging points in a graph? ...

Using LabVIEW to create a simple datalogger.
Hello, Can someone show me how to create a simple data logger. Here's an example, Using a for loop can I keep track of the loop number in an array? In the first loop ,first array would have 1, in the second loop,second array would have 1,2. And in the last loop array N, would have 1,2,3...N. First loop =&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 Second loop =&gt; 1 2 Third Loop =&gt;&nbsp;&nbsp;&nbsp;&nbsp;1 2 3 N loop =&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 2&nbsp; 3 4 . ...

Create a simple webpage using photoshop CS3
Hello dear members, Today, i made a vedio for you that explians how to make a simple webpage using your photoshop. http://www.youtube.com/watch?v=Y6L3jD2ZaRI "mahmoud sayed" <mradwan2009@gmail.com> wrote in message news:111939cf-463e-4277-96cf-4c7df47a1ed1@a32g2000yqm.googlegroups.com... > Hello dear members, > > Today, i made a vedio for you that explians how to make a simple > webpage > using your photoshop. > > http://www.youtube.com/watch?v=Y6L3jD2ZaRI good tutorial but make your voice louder or make the music softer- they comp...

How create a console using java graphical interface
Hi,I am wondering if there is any simple way for creating a console thatoutputs an applicationresults using java graphical interface.I don't wanna use netbeans ora stuff like that,just astandard way.help me please......B. behnaz wrote:...>I am wondering if there is any simple way for creating a console that>outputs an application>results using java graphical interface.I would use JTextArea.append()*, as opposed to System.out.println() for those situations, but Iam not sure I understand your question.* ..but on an *instance* of a JTextArea, of course.>..I don't wanna use n...

Create standalone Windows program with simple graphics?
Hi, I'd like to program and compile a simple graphics program (showing something like a chess board, some numbers and buttons, mouse support) and provide it as a standalone binary for Windows users. What is the easiest way to do that? Which libraries or compilers I should use? On Thu, Apr 16, 2009 at 6:12 AM, Poster28 <usenet1@anton.e4ward.com> wrote: > Hi, > > I'd like to program and compile a simple graphics program (showing something > like a chess board, some numbers and buttons, mouse support) and provide it > as a standalone binary for Windows users. > ...

Using Mathematica to create simple HTML webpages
I have been playing with Mathematicas Export[ ] function in order to create a simple website and would be intereseted in others perspectives, tips and advice. 1. Is the first tip don't do it? 2. When I export to HTML the first thing I find is the formating for Grids and Columns disappears - the text is in the right place but the Frames have gone. Is there a fix? 3. At first I was amazed at how well you could use a Insert Graphic to create a drawing board in which you could place text, graphics, equations etc. All easily positioned (with some patience) and with the ability to overlay st...

Simple question on using for loop to create vector
Hi. I have a simple question on using for loop to create a vector. The size is specified by the user and it can be different each time the program is run. For example: start = 100 termiante = 200 for t = start:terminate y(t) = t end My intention is to create a vector y of size(start:terminate). In this case, y(1) = 100, y(2) = 101,..., y(100) = 200. However, Matlab created a vector y of 200 elements. The first 99 elements are zero. The ultimate goal is to create a vector y whose elements are taken from a segment of vector x. For example: for t = start:terminate y(t) = x(t...

how to create a dropdownlist in C using C graphics
Hello friends I am working on a project in C and C graphics.I want to display name of files in a dropdown list using graphics ,these files can be selected using arrow keys.I also want to dispaly that file on the graphical screen .can anyone provide help on these problems. Pooja. pooja <poojaiz@yahoo.com> scribbled the following: > Hello friends > I am working on a project in C and C graphics.I want to display name > of files in a dropdown list using graphics ,these files can be > selected using arrow keys.I also want to dispaly that file on the > graphical screen .ca...

Simple example of how to use importlib to create a loader
I'm trying to write my own loader using importlib. And frankly, I'm getting nowhere. I'm struggling to understand precisely which methods of the various ABCs I need to implement, and in some cases what they should do. Could anyone point me to a simple example (say, something that implements zip imports using the zipfile module - that was what I initially tried to get working as a proof of concept). Where I've got to is the following stub implementation to try to log the sequence of calls: from importlib.abc import PathEntryFinder, SourceLoader class MyFinder(PathEnt...

REQ: What program can I use to create these font graphics?
http://membres.lycos.fr/clo/Police/dec2003.htm This is a French Font site. Is there anyone out there -- maybe who speaks French -- who can tell me what program may have been used to create the graphics for these fonts? Or, can anyone tell me of some high-quality programs that you know of and/or have used that would do the job? Thanx!!!! If you're asking how he created the actual fonts, it looks like he uses Macromedia Fontographer... if you're asking about the effects applied to the fonts, I couldn't find anyplace where he said what he was using.... "Brooklyn NYC" ...

Using C to create a graphical interface for a prolog program
Hello, I have to create a graphical interface for a program writen using prolog. Does anyone have some code example of a graphical interface using C for a prolog program that can be shared? Thanks. ...

[New to C] Creating a simple animation using C.
Hi, I am new to the C programming language and programming in general. I am writing a simple roulette program. I have everything working so far but it seems a little plain. What I would like to do, but I have no idea how to do, would be to create a simple animation each time the roulette wheel is spun. Something like this. 1 2 3 4 5 6 7 8 9 10 11 31 12 30 13 29 14 28 15 27 16 26 17 25 24 23 22 21 20 19 18 Well it would actually be number 1 -3...

REQ: What program can I use to create these font graphics?
http://membres.lycos.fr/clo/Police/dec2003.htm This is a French Font site. Is there anyone out there -- maybe who speaks French -- who can tell me what program may have been used to create the graphics for these fonts? Or, can anyone tell me of some high-quality programs that you know of and/or have used that would do the job? Thanx!!!! If you're asking how he created the actual fonts, it looks like he uses Macromedia Fontographer... if you're asking about the effects applied to the fonts, I couldn't find anyplace where he said what he was using.... "Brooklyn NYC" ...

Newbie question: how do I slice up a graphic for use in creating a HTML page?
Can someone advise me on how do I slice up a graphic for use in creating a HTML page? I've seen some webpages and the graphics are sliced up into what seems to me to be random sizes. For example, a repeating graphic... somehow the graphic will repeat... but will fit exactly in... how do you determine the exct height or width required!? Thanks. OM In article <1114735824.487772.132180@o13g2000cwo.googlegroups.com>, "OM" <om.newsgroup@gmail.com> wrote: > Can someone advise me on how do I slice up a graphic for use in > creating a HTML page? Use the Slice ...

Recommend the shareware of barcode create and print, it is powerful, simple to use.
Recommend the shareware of barcode create and print, it is powerful, simple to use, support the commonly used barcode type and PDF417 barcode. Website:http://www.zooyo.com 1)Power barcode v1.2 Power Barcode is an easy to use barcode creator that supports all the most popular Barcode types: EAN8, EAN13, UPC-A, UPC-E, CODE 39, CODE 2 OF 5 INTERLEAVED, CODABAR, CODE 128 (A, B and C). And it will support barcode 2D(PDF417,Maxicode and so on) in the next version. Saves in many popular graphic formats, and imports into virtually any Desktop-Publishing or Word Processing software. You can prin...

Creating a simple rule using PDM 3.0(1)
Hi everyone. I would like to prevent a specific external IP address from accessing anything on my Internal LAN. I have just recently loaded PDM 3.0(1) onto my PIX 515 running 6.3(1) and am getting used to it. Let's assume the external IP address that I want to block is 61.132.89.106. When I create a new rule, it wants me to fill in certain information under the ACTION, SOURCE HOST/NETWORK, DESTINATION HOST/NETWORK, and PROTCOL AND SERVICE boxes. Please tell me if what I am choosing is correct. ACTION = deny SOURCE HOST/NETWORK = outside, 61.132.89.106, 255.255.255.255 DESTINATION HOST/NET...

creating graphical user interface for macros using PROC MIRP
Can anyone of u please help regarding creating graphical user interface for macros using PROC MIRP?very urgent....please respond...... On Sep 24, 8:25=A0am, peesari.mah...@GMAIL.COM ("SUBSCRIBE SAS-L Joe H. Smith") wrote: > Can anyone of u please help regarding creating graphical user interface > for macros using PROC MIRP?very urgent....please respond...... Look into the WINDOW or %WINDOW statement. -- Richard A. DeVenezia http://www.devenezia.com ...

Creating a simple "hello world" application using zope
I am using Debian Lenny and I have installed the zope3 package. I want to create a simple "hello world" page for display using the inbuilt web server. As root, I try to start the zope package as follows: /etc/init.d/zope3 start This gives an error: Zope3: no instances found I now type: dzhandle make-instance hello This gives me an error: dzhandle make-instance: ambiguous zope version to make instance for: `2.6', `2.7', `2.8', `2.9', `2.10', `3' I was expecting this to create an instance named hello, that I could use to create my "hello world&qu...

SN#22826 "Creating a Simple Web Application Using a MySQL Database"
SYSTEM NEWS FOR SUN USERS Vol 144 Issue 3 2010-02-18 Article 22826 from section "MySQL" Tutorial for Beginners Possessing Basics on Web Development Learn how to create a simple web application that connects to a MySQL database server in a tutorial authored by Troy Giunipero, who also covers other web development technologies in his piece, such as JavaServer Pages (JSP), JavaServer Pages Standard Tag Library (JSTL), the Java Database Connectivity (JDBC) API, and two-tier, client-server architecture. Details at http://sun.systemn...

Using Biology To Create Electronics: DNA Used To Create Self-assembling Nano Transistor...
Source: American Society For Technion - Israel Institute Of Technology Date:2003-11-21 Using Biology To Create Electronics: DNA Used To Create Self-assembling Nano Transistor NEW YORK, N.Y., and HAIFA, Israel, November 17, 2003 - Scientists at the Technion-Israel Institute of Technology have harnessed the power of DNA to create a self-assembling nanoscale transistor, the building block of electronics. The research, published in the Nov. 21, 2003 issue of Science, is a crucial step in the development of nanoscale devices. Erez Braun, lead scientist on the project and associ...