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 5007 articles. 0 followers. Post Follow

5 Replies
359 Views

Similar Articles

[PageSpeed] 2

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:

Create copy of non ASM database to ASM database on different server
I am looking for the quickest/easiest way to create a copy of a large (230 Gb) database. The situation is as follows : The source database is on a non ASM Oracle instance (on machine A). I would like to create a copy of this database and place it on machine B. Machine B has an ASM instance on it and I would like the database to use the ASM disk groups that are setup on this machine. I have seen examples of using "rman duplicate" to create a copy of a database but they do not appear to cover the situation where the source database is non ASM and the destination database ...

RAC 10.2 on ASM, windows
Hi all, how can I create a pfile (on filesystem) from spfile, if spfile is on ASM. I cannot open my db with startup nomount. I have an ORA-00371: not enough shared pool memory I'm trying to fix this but cannot create the pfile. thanks, pedro On 18 Jan, 15:45, Pedro Lopes <pedro.lo...@netvisao.pt> wrote: > Hi all, > how can I create a pfile (on filesystem) from spfile, if spfile is on ASM. > > I cannot open my db with startup nomount. > > I have an ORA-00371: not enough shared pool memory > > I'm trying to fix this but cannot create the pfile. > &...

Theoretically, CCIDE could be used to decompile x86 asm in C?
Hello. William Gallant here. A little off-topic mixed with x86 asm topic. I was looking for something to decompile 16bit asm into psuedo-code or better. I stumbled across a program called CCIDE. It takes decision tables embedded in C, VB, Java, and others and produces compilable C. I don't know much assembler and have been trying to figure the workings of a DOS program i have. I disassembled my DOS program with IDA Pro Free version and created an asm output file. Using CCIDE with asm mnemonics arranged in decision tables, it makes sense to me i can achieve a decompilation of m...

should I use ASM?
I've been scowling the net via google to find some answers to questions I have.. Here is the background to the situation I'm faced with: Firstly I have a pet project I'm working on where I've written a wrapper in C for making tcp/ip programming portable and easier between Linux and Windows. Along with this API I've included some wrappers for threads and mutexes -- some might argue that I'm re-inventing the wheel but as I said this is a pet project and it's for my personal knowledge and use. So I've also managed to also write some code that impleme...

ASM
I having trouble using ASM, im getting "ERROR ON BDOS k: SELECT" the k: can even be m: i dont understand! im getting it on two different copies! can someone tell me why? Roger On 2009-03-30, Roger Schmidt <roger@ammeberg.com> wrote: > I having trouble using ASM, im getting "ERROR ON BDOS k: SELECT" the k: > can even be m: i dont understand! im getting it on two different copies! > can someone tell me why? You'll have to be a bit more specific. What command did you use? The ASM command is kind of funny in that the three letters after the name of the...

asm
Hey everyone...quick question for you. I was under the impression that the `asm' command was not part of standard C++ because all assembly language instructions are machine dependent. However, I noticed that in the grammar appendix of Stroustrup, the `asm' command is actually listed. I don't actually have a copy of the standard, so I was just wondering: Is the `asm' command actually part of standard C++?? ***************************************************** Josh Lessard Master's Student School of Computer Science Faculty of Mathematics University of Waterloo (519)888-4...

ASM
Hi there Does anyone know if it's possible somehow to write inline assembler code or link assembler to an m-file ? Thx in advance ! Best regards Kee ...

Converting CodeWarrior asm to GCC asm
I do not know asm but am trying to convert a library from CW to GCC and it has a little asm in it. asm UInt32 ZenPlus::GetA5() { move.l a5, d0 rts } asm UInt32 ZenPlus::SetA5(UInt32 inNewA5) { fralloc move.l a5, d0 move.l inNewA5, a5 frfree rts } inline asm MemPtr ZenPlus::SetA7(MemPtr inNewA7) { move.l sp, a0 move.l (sp), sp } ZenPlus is a namespace not an object. This is a library for the palm os if that helps. Thanks. Jason J Breitweiser wrote: > I do not know asm but am trying to convert a library from CW to GCC and > it has a little asm in it. > > asm UInt32...

Convert intel asm to djgpp asm
Hi, I need help to convert my inline asm to djgpp inline asm. here is the code I need to be convert over. How to convert the following my inline asm code to djgpp inline asm : short mul5[4] = {5, 5, 5, 5}; void 06_mmx_dec_smv2(unsigned char* dest, int st1, unsigned char* sour, int st2) { short temp[36]; sour -= (st2<<1); __asm { lea esi, temp mov edi, sour mov eax, 9 pxor mm7, mm7 loop06_1: movd mm0, [edi- 2] punpcklbw mm0, mm7 movd mm1, [edi- 1] punpcklbw mm1, mm7 pmullw mm1, mul5 movd mm2, [edi] movq [esi], mm0 add esi, 8 add edi, st2 dec ...

Graphic, ASM, Linux
Hello! I've searched the net but I didn't find anything that would fit my requirements. My problem is to write a code for GAS that would run properly on most machines and displayed some things in graphic mode (no root access needed, without using framebuffer, etc.) Could somebody help me? I'd appreciate a link, etc. or even sth like: "That won't work! Don't bother." "Jan Kowalski" <wojciechbulaty@op.pl> wrote: > >I've searched the net but I didn't find anything that would fit my >requirements. My problem is to write a code for...

Asm graphics under cc65?
cc65 has a graphics library called TGI. However, for the C64, it only supports Hi-Res mode and the colors are defined for the full screen. I am looking for multi-color graphics for cc65. I will even translate the library if I have to. Or should I crete my own? "Harry Potter" <maspethrose7@aol.com> wrote: >cc65 has a graphics library called TGI. However, for the C64, it only >supports Hi-Res mode and the colors are defined for the full screen. Go download my Aztec64 cross-compiler bundle: The library and source is all there. I handle both. Many formats directly. h...

General Use of ASM
hello everyone, I am starting to learn ASM, and I was just curious what do most people use ASM for? Is there a particular market that requires ASM programming skills? I wanted to learn a lot about drivers, and my friend suggested that I learn ASM to help me debug device drivers.. is he accurate? Thanks On 24 Aug 2006 14:24:01 -0700, "sleeper" <spamtrap@crayne.org> wrote in comp.lang.asm.x86: > hello everyone, > > I am starting to learn ASM, and I was just curious what do most people > use ASM for? Is there a particular market that requires ASM > program...

simple asm question
both of these routines effectively do the same thing? as far as i understand... they do.. Just want to confirm eg: we have a routine that tests if bit 1 is set variation 1) and al,0002h jz not_set variation 2) and al,0002h cmp al,0000h jne not_set they should behave the same way? I am in a position where I am trying to optimise some code. both seem to behave identically in in the debugger. Its perfectly ok for me to use the first variation isnt it? and just check to see if the zero flag has been set, rather than do a "cmp"? if i am testing for 1 single bit in a field ...

Debugging some simple asm
Hi all, I'm trying to relearn some assembly (catching up from about 20 years ago). For me an important part of learning is debuging. However I fail to do so. In my makefile (I'm on linux) I have: EXES=hw clean all : $(EXES) hw : hw.o oefenlib.o ld -o hw hw.o oefenlib.o oefenlib.o : oefenlib.asm nasm -g -f elf oefenlib.asm -w-orphan-labels hw.o : hw.asm nasm -g -f elf hw.asm -w-orphan-labels clean : rm *.o rm *~ I was thinking/hoping that the -g switch provides for the debug information in the objectfiles/executables. When I try to debug...

What about ASM...
Hi all, where can I found information about accessing the graphic card in ASM ? I believe the book Tricks of the Game-Programming Gurus had a section on that. http://www.amazon.com/exec/obidos/ASIN/0672305070/freeeducation-20 Jon ...

Web resources about - How to create simple graphics using ASM - Help ! - comp.lang.asm.x86

Graphics Interchange Format - Wikipedia, the free encyclopedia
The Graphics Interchange Format ( GIF ; / ˈ dʒ ɪ f / or / ˈ ɡ ɪ f / ) is a bitmap image format that was introduced by CompuServe in 1987 and ...

GDDR5X Standard Finalized by JEDEC: New Graphics Memory up to 14 Gbps
... GDDR5X specification , with accompianing white papers. This is the memory specification which is expected to be used for next-generation graphics ...

Graphics cards with 1024GB/s bandwidth? Samsung begins HBM2 production
... to 256 gigabytes-per-second (GB/sec) of available bandwidth per memory stack—double that of the first generation HBM used in AMD's Fury graphics ...

US defense budget graphic - Business Insider Deutschland
The US spends almost three times as much on defense as the next-highest spender.

AMD's new FirePro server GPUs can turn a basic PC into a graphics powerhouse
If you have an under-powered PC but need the horsepower to see high-definition video or edit intense graphics, AMD has your back. AMD's new ...

Graphic Novel ‘The Time Museum’ Latest Broad Green Deal
EXCLUSIVE : Broad Green has acquired the graphic novel series The Time Museum for Josephson Entertainment’s Barry Josephson and Liz Bassin to ...

China-based Colorful to launch graphics cards in overseas markets
China-based Colorful, currently the largest graphics card vendor in the China market with shipments of over four million units for a market share ...

Samsung is building chips for next-gen gaming graphics
Samsung likes being the first kid on the block with new memory products, and has done it again with a type of DRAM. The so-called HBM2 modules ...

John Oliver Shares Last Week Tonight's Best Unseen Graphics Group Group
​Of course, ​Paul Giamatti is&nbsp;dressed as a mango​.​ Graphics departments are the unsung heroes of a good news program. When the show is ...

JEDEC certifies GDDR5X — will AMD, Nvidia tap it for next-gen graphics after all?
The memory standard consortium JEDEC has released an official standard for GDDR5X. The new memory is based on existing GDDR5 and doubles memory ...

Resources last updated: 2/2/2016 8:29:23 PM