[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

07/29/1997 at 12:38PM PDT, ID: 10018621
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

C to assembly conversion help

Asked by Doug8 in C Programming Language

Tags: c, conversion

Hello, I am having trouble converting this function to assembly because i barely know assembly, so i need some help.  Below is the C function(bout 20 lines) and after that is what i have started on(I know its all wrong). So let me explain the variables below:

is_cached - is hit a lot more often
n - is from 0 to 319
tex - is char *
tex_row_table - is int [258]
swim_u & swim_v - is int [256]
g_mip - is int either 0,1,2,3
wid * ht - are int

#include "s.h"
#include "fix.h"
#include "tm.h"

void draw_affine(int n, char *dest, fix u, fix v, fix du, fix dv)
{
   if (is_cached) {
      while (n--) {
         int iu = u >> 16;
         int iv = v >> 16;
         *dest++ = tex[tex_row_table[iv+1] + iu];
         u += du;
         v += dv;
      }
   } else {  
      while (n--) {
         int iu = ((u + (swim_u[(((v<<g_mip) >> 16) & 0xff)] >> g_mip)) >> 16) & wid;
         int iv = ((v + (swim_v[(((u<<g_mip) >> 16) & 0xff)] >> g_mip)) >> 16) & ht;
         *dest++ = tex[tex_row_table[iv+1] + iu];
         u += du;
         v += dv;
      }
   }
}

this is what i have for assembly; (just for some sorta skeleton ;)

      .file "affine.asm"
      .medium
      .486

_global draw_affine

draw_affine:

      mov si,n
      les di,dest
      mov eax,u
      mov ebx,v
      mov ecx,du
      mov edx,dv
      mov ax,tex_row_table
      cmpl is_cached,0
      je scandone

scanloop:
            
      add ax,eax
      add ax,ebx
      adc bx,ax
      mov bx,tex
      mov ah,[bx]
      mov es:[di],ah
      add eax,ecx
      add ebx,edx
      dec si
      jnz scanloop

scandone:

      ret

so im sure a lot, a lot of that is wrong so thats why i need help, i also only attempted the if(is_cached).  This should be enough points for this, and any other questions email me at benco@gisco.net.

Thanx a lot in advance
[+][-]07/29/97 03:06 PM, ID: 1252695

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/29/97 03:29 PM, ID: 1252696

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/29/97 05:04 PM, ID: 1252697

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/29/97 05:38 PM, ID: 1252698

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/29/97 06:04 PM, ID: 1252699

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/29/97 06:52 PM, ID: 1252700

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/29/97 11:36 PM, ID: 1252701

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C Programming Language
Tags: c, conversion
Sign Up Now!
Solution Provided By: mosfet
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20091111-EE-VQP-91