Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Bruno

Assembly in VC 6 ++

This topic is 6495 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I''m tryng to make a little assembler function inside VC, and i keep getting a stupid compilation error. The error is: D:\diske\test.cpp(463) : error C2415: improper operand type being the line 463 the last assembler line. If i delete that line, then the compiler will go to the previous line, and so on, until i have no assembler code.. lol With _asm before each line, the result is the same., do i have to setup visual c, somewhere, so that i can compile asm inline code? thanks My code, is the following: void drawH(int ymin,int ymax,int y) { int i=ymin; __asm { um: mov ax,1 mov sbuffer[y],1 cmp i,ymax jne um } } thanks Bruno

Share this post


Link to post
Share on other sites
Advertisement
If it''s anything like Borland, it should be like this:

void drawH(int ymin,int ymax,int y)
{
int i=ymin;
__asm {
um:
mov ax,1
mov sbuffer[y],1
cmp i,ymax
jne um
}

Notice the squigily bracket just after __asm

Share this post


Link to post
Share on other sites
Just a thought: do you have a ";" after it all?
like:
    
__asm
{
//code

};

??

BTW, I have no experiense of assembler in VC++

Share this post


Link to post
Share on other sites
It''s been a long time ago since I''ve done assembly, but I think this will compile:

    
void drawH(int ymin, int ymax, int y)
{
int i=ymin;

__asm
{
um:
mov ax, 1
mov WORD PTR [sbuffer+y], 1
cmp i, ymax
jne um
}
}



btw. Just a question, why are you filling sbuffer with one byte at a time?

Share this post


Link to post
Share on other sites
Hi
thanks for the replys.
I have just started assembler., i''m filling one byte at a time, because i still don''t know a fast way to do it

I still can''t compile, i tried everything you guys said, my compiler simply refuses any assembler command.. , any ideias ???

Share this post


Link to post
Share on other sites
This works :D. I think it''s an endless loop though . I don''t know much asm at all. I learned just enough to understand adresses and values for pointers.

    __asm
{
um:
mov ax, 1
add ax, 2
jmp um
}

Share this post


Link to post
Share on other sites
sbuffer's global?

I don't think you can do a [][] in asm

You have to do it in multiple steps, [][] takes 2 derefences

Edited by - Magmai Kai Holmlor on October 7, 2000 8:29:29 PM

Share this post


Link to post
Share on other sites
Hmm.. don''t the labels have to be outside the brackets?

like:

void drawH(int ymin,int ymax,int y)
{
int i=ymin;
um:
__asm
{
mov ax,1
mov sbuffer[y],1
cmp i,ymax
jne um
}

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!