123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|546|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> ASM

Thu, 19 Aug 2010, 09:57
Afr0
My knowledge of ASM isn't as steady as it used to be. I haven't done it for aaagess.

Could someone provide a well-versed translation of the following rhymes?



How would this look in... say, C#?

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Thu, 19 Aug 2010, 10:01
waroffice
I tried google translate but it didnt work
Thu, 19 Aug 2010, 10:03
Afr0
I don't think Google Translate deals in programming languages yet.

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Thu, 19 Aug 2010, 10:09
CodersRule
That's a good idea though...
Thu, 19 Aug 2010, 10:20
Afr0
Could someone at least make a guess as to what A stands for in the function names? All the other letters (D, W) are pretty much explained...

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Thu, 19 Aug 2010, 10:50
JL235
Address? Perhaps 'push ax' is about pushing the value stored at ax onto the stack.

Just a guess tho.
Thu, 19 Aug 2010, 17:05
Afr0
I figured it out. The functions are used to pack a binary buffer to and from a DWORD and WORD.

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Thu, 19 Aug 2010, 18:52
dna
I would be a real big coup if and when google begins to translate programming languages.

-=-=-
DNA
Fri, 20 Aug 2010, 05:52
JL235
I don't think translating between programming languages would really work. Different languages tackle the same problems in very different ways.
Fri, 20 Aug 2010, 11:54
dna
Yes, but when translating, a person could get the solution for a problem not necessarily found in a particular language.



-=-=-
DNA
Fri, 20 Aug 2010, 12:36
JL235
I don't quite follow.

I suppose what I mean is, a Java solution to a problem would use classes whilst there are many languages which don't support classes. Most programmers also use while, do and for loops in their code however there are plenty of languages (such as Haskell) which don't support loops (you use recursion instead).

In hiensight I actually think it would be relatively easy to technically translate code from one language to another. The issue is that I think the resulting code would always end-up looking very unnatural in the new language, even to a point where the resulting code couldn't really be used.
Tue, 31 Aug 2010, 05:15
waroffice
couldnt you compile the code in one language and then reverse engineer the executable to create the new language version?

gone a bit OT this tread, my ASM knowledge has faded since my college days, too much sleep/beer/non-ASM-related-coding in between
Tue, 31 Aug 2010, 06:07
JL235
waroffice couldnt you compile the code in one language and then reverse engineer the executable to create the new language version?
I think there are simpler ways then that. For example you could easily convert Blitz Basic functions to Java ones by converting the functions into public static methods. All global variables can be turned into public static variables and the all code can exist in one class.

However most Java solutions are not fully static and aren't contained in a single class. So you'd end up with a correct translation which is a very bad Java solution. Essentially the way you do things in one language isn't the same as how you'd do it in another. It would be a programming language version of Engrish.

To make a good translation you'd need to properly understand what the program is trying to achieve, like on a human level. That could then work out which bits of the BB code should be static methods and which bits should be altered and turned into non-static classes. A translator that could do that would be really hard to build.
Tue, 31 Aug 2010, 06:08
steve_ancell
waroffice my ASM knowledge has faded since my college days, too much sleep/beer/non-ASM-related-coding in between


LOL. I think that happens to a lot of people. I think the medical term for it is Brainrot or something !