add assembly language

bert aalders

Member
Joined
Mar 4, 2011
Messages
16
Programming Experience
Beginner
I'm new at vb
I used to program in delphi.
now i try to rewrite my program in vb.
in the old program i had to do some assembly.

VB.NET:
[FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]'machinetaal[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]            
[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]'   asm()[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2]
[/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]'    mov(al, Zoekstartpositie)[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2]
[/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]'add ax,00B5H[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2]
[/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]'     mov(beginstartpositie, al)[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2]
[/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000]'     End[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
beginstartpositie = sbyteZoekstartpositie = Asc(codering(2))
when i just add both values it don't works.
how to solve this?

 
If you don't want to add assembly language then why is your thread named "add assembly language"? If you want to translate assembly language into VB then I can think of a more appropriate title.

As for the question, maybe you could describe what it is that you actually want to achieve instead of expecting us to work it out from the asm and some VB that is obviously wrong. Is it too much to ask for a clear description of the problem? If what you actually want to do is to assign the same value to two different variables then that's what you have to do. One line in VB can only perform one assignment so it will need to be done on two lines. If that's not what you're trying to do then that clear description would be greatly appreciated.
 
i use this code to encrypt en decrypt data.I did not know how to write this part in delphi so i added it in asm.
In delphi you can jut use asm() to use assembler parts.
Because you say "You can't write assembly in VB" i need a solution to translate it to VB.
The add is not an command in vb so the question changes to how to solve this in vb
 
i use this code to encrypt en decrypt data.I did not know how to write this part in delphi so i added it in asm.
So actually you have no idea what your assembler code does?
Where did you get that code?

I think it is the equivalent of this Delphi code
VB.NET:
    beginStartPositie := ZoekStartPositie + 181;
Is that possible?

Also: .NET has several encryption libraries. Why not use one of those?
 
im a newby at vb
That is not the problem here.
The problem seems to be that you have some assembler code and you seem to have no clue about what it does.

the value B5 = a sbyte
Says who?


i'v nevercalculated with this.
what does a sbyte do with this, is it then -53?
No, trying to assign the value 181 (decimal) or B5 (hexadecimal) to a System.SByte, will result in a System.OverflowException.

Take a step back: describe what needs to be done exactly and then ask how it can be done in VB.NET ...
 
Back
Top