Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] difference between assembly language and embeded c

Status
Not open for further replies.

rajupj

Newbie level 5
Newbie level 5
Joined
Jan 7, 2013
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,333
hi....!
can anybody give me an example to sought difference between assembly and embeded c.
like for instruction "mov AL,61h"
give me its equivalent assembly and c instruction????:oops::oops:
 

can anybody give me an example to sought difference between assembly and embeded c.
like for instruction "mov AL,61h"
give me its equivalent assembly and c instruction???

The following is an Assembly Language statement:

Code:
MOV AL,61h

Without know the specific assembler and device it's difficult to know the specific result when the resulting code is executed.

Several possible results could be the value 61 in hexadecimal being stored in the lower byte of Accumulator A, another register known as AL or a location in RAM with an address known as AL.

Depending on the exact out come of the code execution, an equivalent C statement might be:

Code:
AL = 0x61;


BigDog
 

People talk about 'embedded C' but usually they just mean 'C'.
Dy you really mean this?

Are you an engineering student? If so, then consider what a microprocessor consists of,
and consider that different processors will implement different instructions. Also, consider that
an instruction is a set of values that the processor executes. You calling them 'mov AL' is
a human way of representing an instruction in a simpler (for humans) to understand syntax.
The syntax is different from machine to machine.
C is a higher level language designed to be agnostic to the processor architecture.
Typically, a compiler may convert a C line of code to maybe 1 or
more lines of assembler, and it will depend on the rest of the code in the vicinity of the
line of code that you are interested in.
So, the C line "bob=0x61;" may represent the line of assembler that you showed,
or it might be something completely different, like "bob=0x9961;" or it may be part of
"for (i=0x61, i>0x59; i--)" or a million other different things...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top