×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Speed question

Speed question

Speed question

(OP)
I am going to be using an offscreen screen 13 buffer (one dimension) so I am going to have to use (y * 320 + x)64000 times every frame.  I am assembly illiterate, I was wondering if someone out there would help me out with a line of assembly to do that quicker than Qbasic would.

Is there a reason hexidecimal is used more often than decimal, is it faster?

RE: Speed question

Y * 320

is the same as

(Y * 256) + (Y * 64)

or

(Y * 2^8) + (Y * 2^6)

So

Offset = Y<<8 + Y<<6 + X

Something like this:

CODE

MOV AX, (y)
MOV BX, AX
SHL AX, 8
SHL BX, 6
ADD AX, BX
MOV BX, (x)
ADD AX, BX

I's been awile since I did this so you might get someone else to help you with the details...

Have Fun, Be Young... Code BASIC
-Josh

http://cubee.topcities.com

PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close