Computing.Net > Forums > Programming > ASM Pixel Question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ASM Pixel Question

Reply to Message Icon

Name: Misty
Date: June 8, 2002 at 20:39:41 Pacific
Comment:

I am trying to place maybe five pixels on the screen at one time. I posted a few weeks back and somebody showed me how to get one pixel on. It went something like this in debug:

mov ax, 0004
int 10h

mov bx, b800
mov ds, bx
mov bx, 1000
mov word ptr[bx], 0055h

That would place one pixel in the video memory at b800:1000 and it would appear on the screen. So how can I do it for five pixels?
Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: cup
Date: June 9, 2002 at 21:44:33 Pacific
Reply:

My assembler is a bit rusty - haven't used it in anger since 1985. Anyway, to access 5 consecutive pixels, it would be something like this

mov ax, 0004
int 10h

mov bx, b800
mov ds, bx
mov bx, 1000
mov cx,5 ; Number of pixels
more:
mov word ptr[bx], 0055h
inc bx
loopnz more ; dec cx and do the next one


0

Response Number 2
Name: Misty
Date: June 10, 2002 at 10:41:13 Pacific
Reply:

I do not have much experience in ASM yet. How do I dec CX?


0

Response Number 3
Name: ddddummy
Date: June 10, 2002 at 11:06:20 Pacific
Reply:

I think the "dec cx" was meant as a comment..

> loopnz more ; dec cx and do the next one

The loop operations decrease CX automagically and jump to the label (here: 'more:'), when cx satisfies a certain condition (here: nz = is not zero).

Just ignore everything after ";"s - it is comments.



0

Response Number 4
Name: Misty
Date: June 10, 2002 at 12:03:13 Pacific
Reply:

Thanks for the clairification!


0

Response Number 5
Name: John W. Borelli
Date: June 10, 2002 at 21:08:33 Pacific
Reply:

The above responses will depend on the video mode being accessed. If we are talking about "mode x" (&h13) then direct video memory access as the examples above indicate would be sufficient. However, just about every higher definition mode requires page swapping through the video card registers and that can vary upon the video card and video modes supported so you may want to consider this or at least look into it if it applies to your application.

borelli33


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: ASM Pixel Question

ASM: Easy Question www.computing.net/answers/programming/asm-easy-question/1655.html

Assembly Pixel Question www.computing.net/answers/programming/assembly-pixel-question/1750.html

ASM question (code inside) www.computing.net/answers/programming/asm-question-code-inside/2989.html