Can someone write me a program in ASM ?? (digital thermometer, LM35)

dor

Joined Feb 20, 2009
63
I think it may be a distinction without much of a difference. The only real advantage my be some regularity of stucture, since goto statments, although allowed, are mercifully rare.
Can you please clarify? English isn't my native language so I didn't understand what you mean. Thank you :)
 

Papabravo

Joined Feb 24, 2006
21,228
Sure. In assembly language it is possible to implement irregular control structures with random jumps to unrelated parts of the program, making such a program difficult to follow, understand and maintain.

Programming in C tends to enforce more regular control structures. It is difficult to transfer control from inside a loop to another part of the program. Even so difficult is not the same thing as impossible. The C language has a goto statement that is rarely used. It is possible to do things in C that will make recreating the source code from a binary file difficult.
 

dor

Joined Feb 20, 2009
63
Oh ok.
So you meant that it is difficult to reconstruct the C source code from a binary file.

But I meant to reconstruct an ASM source code from a binary file, which is what Baron1 wanted.
Since each ASM command has a machine code counterpart, then I think that it's very easy to convert a binary file to an ASM file.

Please correct me if I'm wrong.
 

spinnaker

Joined Oct 29, 2009
7,830
Oh ok.
So you meant that it is difficult to reconstruct the C source code from a binary file.

But I meant to reconstruct an ASM source code from a binary file, which is what Baron1 wanted.
Since each ASM command has a machine code counterpart, then I think that it's very easy to convert a binary file to an ASM file.

Please correct me if I'm wrong.

Do you mean a disassembler? But I believe the OP wanted to convert ASM to C which is very difficult to do directly. The best way to do it is use the concept of the ASM but just rewrite the C code from scratch. (as previously stated).
 

Papabravo

Joined Feb 24, 2006
21,228
Oh ok.
So you meant that it is difficult to reconstruct the C source code from a binary file.

But I meant to reconstruct an ASM source code from a binary file, which is what Baron1 wanted.
Since each ASM command has a machine code counterpart, then I think that it's very easy to convert a binary file to an ASM file.

Please correct me if I'm wrong.
Your opinion will have more credibility after you've done it for the first time. It is harder than it looks.
 

dor

Joined Feb 20, 2009
63
Yes, I mean disassembler (and always meant that. Didn't you read my posts? :confused: )

But I believe the OP wanted to convert ASM to C which is very difficult to do directly.
But the OP wrote:
Baron1 said:
can someone write the program for this circuit in Assembly for me
Am I misunderstanding something..?

The best way to do it is use the concept of the ASM but just rewrite the C code from scratch. (as previously stated).
I think so too :)
 

maxpower097

Joined Feb 20, 2009
816
The best way to do it is use the concept of the ASM but just rewrite the C code from scratch. (as previously stated).
I had to do this with an ASM program before. 1st off converting from handwritten ASM to C was impossible by automation. We even had an expert from MC come and review the code and device and his solution was to start from scratch. He said you would probably spend more time trying to convert the ASM to C then to just write the C from scratch.
 
Top