Log in

View Full Version : mission possible?:o


skiz
24-03-2009, 00:14
Is there such a thing or a way such that a window that is popped out by clicking a .exe file be changed to a .hex file? Or is it impossible?:yikes:

EricH
24-03-2009, 00:40
What language are you programming in? Most people here speak C, C++, or Labview almost exclusively. Delphi users should see this thread (http://www.chiefdelphi.com/forums/showthread.php?t=29944) (or the message that popped up when you posted in this subforum).

Despite having "Delphi" in the site name, very few here code in that language. This site is run by a FIRST Robotics Competition (http://usfirst.org/) team that is sponsored in part by Delphi Automotive, hence the name of the site. If you have any questions about the competition, or the languages used in the competition (namely, C, C++, and Labview), feel free to ask us.

RyanCahoon
24-03-2009, 01:35
Is there such a thing or a way such that a window that is popped out by clicking a .exe file be changed to a .hex file? Or is it impossible?:yikes:

Assuming you're post fits the topic of the forum (as described in EricH's post), I also assume you're talking about somehow converting a Window Executable (http://en.wikipedia.org/wiki/Portable_Executable) into a program image file (http://en.wikipedia.org/wiki/Intel_HEX) for an embedded microcontroller (http://en.wikipedia.org/wiki/Microcontroller). While this is theoretically possible, you'd have to find a program that converted the machine code (http://en.wikipedia.org/wiki/Machine_code) from one processor architecture (http://en.wikipedia.org/wiki/Instruction_set) (ISA) to another. In doing so, you'd be essentially integrating a minimal virtual machine (http://en.wikipedia.org/wiki/Virtual_machine) into the code at compile time, because the chances that you could directly convert from instructions in one ISA to another are quite small, especially since you're going from a desktop processor (probably x86 (http://en.wikipedia.org/wiki/X86) and therefore a CISC (http://en.wikipedia.org/wiki/Complex_instruction_set_computer)) to an embedded processor, which is probably a RISC (http://en.wikipedia.org/wiki/Reduced_instruction_set_computer), which means that one instruction in the EXE file would probably correspond to multiple instructions in the HEX file. Also there would have to be a mechanism for translating memory addresses from one computer architecture to another. Essentially what you would be making is a compiler that translates x86 machine code into your embedded processor's machine code, which might be even harder than writing something like a C compiler, because C is designed to be a more or less portable language. I don't know of any product available that does this.

It should also be noted that this description thus far is assuming that the entirety of the code takes the form of direct processor instructions, and that your program doesn't make use of any hardware interrupts (http://en.wikipedia.org/wiki/BIOS_interrupt_call), operating system calls (http://en.wikipedia.org/wiki/System_call) (it is highly likely that it does considering you mention that your program has a graphical interface), or dynamic loading (http://en.wikipedia.org/wiki/Dynamic_loading). Such utilities have no analog on a microcontroller.

In short, I know of nothing that exists that works the way you want. A better approach would be to go back to the source code (hopefully in a common language like C) and convert that to the desired platform.

Lots of good information at the linked Wikipedia articles if you want to do some more reading on the subject of computer architectures.

Good luck,
--Ryan