Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Assembler ebx,ecx registers do not work?

DSP related issues, mathematics, processing and techniques

Assembler ebx,ecx registers do not work?

Postby KG_is_back » Mon May 18, 2015 10:31 am

Following code (while loop) works fine when eax is used, but crashes if any other register is used (in this example ebx). It also crashes if one of mentioned registers is in any way involved in counting loop index.
Code: Select all
streamout out;
float F1=1;
push ebx;

mov ebx,32;
loopjmp:
sub ebx,32;
jl finish;

//this code doesn't matter (it only counts loop length)
   movaps xmm0,out;
   addps xmm0,F1;
   movaps out,xmm0;

jmp loopjmp;
finish:

pop ebx;

is this a bug? or am I doing something wrong?

even following code crashes:
Code: Select all
streamout out;
float F1=1;
push ebx;

mov eax,32;
mov ebx,eax;
loopjmp:
mov eax,ebx;
sub eax,32;
jl finish;
mov ebx,eax;
//this code doesn't matter (it only counts loop length)
   movaps xmm0,out;
   addps xmm0,F1;
   movaps out,xmm0;

jmp loopjmp;
finish:

pop ebx;

it seems to me that "mov" instructions are buggy...
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Assembler ebx,ecx registers do not work?

Postby martinvicanek » Mon May 18, 2015 8:12 pm

Confirmed. Even an ASM hop will crash if you replace eax by ebx:

This works:
Code: Select all
streamout dummy;
float F1=1;
mov eax,ecx; and eax,7; cmp eax,0; jnz end0;
movaps xmm0,dummy;
addps xmm0,F1;
movaps dummy,xmm0;
end0:

This crashes:
Code: Select all
streamout dummy;
float F1=1;
mov ebx,ecx; and ebx,7; cmp ebx,0; jnz end0;
movaps xmm0,dummy;
addps xmm0,F1;
movaps dummy,xmm0;
end0:
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Assembler ebx,ecx registers do not work?

Postby KG_is_back » Mon May 18, 2015 8:31 pm

I think I know what the issue is:
You can also now use ebx, ecx and edx in the following opcodes:

add reg, reg
add reg, var
sub reg, reg


there is no "sub reg, integer"
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Assembler ebx,ecx registers do not work?

Postby MyCo » Mon May 18, 2015 9:12 pm

The e-registers support is very chaotic... thought Malc would sort it out, but it got worse. eg. "sub reg,int" only works with eax, while "add reg,int" works only with eax and ebx, and "and reg,int" works with eax,ebx,ecx but not edx... and so on... you basically have to check if the opcode output has something in it for every instruction.

In the latest version, "add/sub reg,reg" also support edx, edi and ebp... although you can't push/pop them for rescuing content... and the opcode output for ebp and edi are the same, so they are obviously wrong.

It's such a mess...
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Assembler ebx,ecx registers do not work?

Postby Tronic » Tue Jun 09, 2015 11:31 am

psrld
Work for you?
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Assembler ebx,ecx registers do not work?

Postby martinvicanek » Tue Jun 09, 2015 9:54 pm

nope
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Assembler ebx,ecx registers do not work?

Postby Tronic » Tue Jun 09, 2015 10:43 pm

grrr :x
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm


Return to DSP

Who is online

Users browsing this forum: No registered users and 18 guests