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.

how to multiply two number in 8051

Status
Not open for further replies.
Joined
May 20, 2017
Messages
54
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
0
i wrote this code
the output in led is 00001011
why?
it should be 00000010


Code:
org 0000h
	
	main:	

clr a
mov a,0x02
mov b,0x00
mul ab


	mov p1,a
	
	END
 

the output in led is 00001011
why?
it should be 00000010
Why 00000010?
Do you mean MOV A, 0x2 or MOV A, #0x2? In the former case, what's the content of the respective registers?
 

ok # mean immediate value to be loaded
what does 0x2 will do?

- - - Updated - - -

when i divide it only tell integer value not floating point after decimal how to get decimal value is it possible in 8051 or suggest other controller?
 

Guess you should spend some time on studying 8051 architecture and instruction set.

0x02 in direct addressing refers to R2, register bank 0. MOV A, 0x2 is the same as MOV A, R2 with Bank 0 selected.

- - - Updated - - -

If you want float calculations with 8051, you'll use a C compiler to generate the machine instructions. It's possible, but no fun due to the limited data and program memory capacity of most 8051 processors.

Why did you choose 8051 in 2017? Why assembly coding?
 

Do you mean MOV A, 0x2 or MOV A, #0x2?
the connect is not same in both

- - - Updated - - -

Why did you choose 8051 in 2017? Why assembly coding?
for basic ok then which one to pick?

- - - Updated - - -

can we do decimal floating point in pic or arm?
 

can we do decimal floating point in pic or arm?
You can do it with any processor that has certain memory capacity for code and data. That's serial terminal output of a 8051 processor. PIC or arm can do as well.
19.3 19.9 18.8 8.4 10.0 -0.26
19.3 19.9 18.8 8.5 10.1 -0.26
19.4 19.9 18.8 8.5 10.1 -0.26

Here's the code generating it

Code C - [expand]
1
2
3
4
5
printf("%4.1f ",cm_d);
for (i=0;i<=2;i++) 
    printf("%4.1f ",c[i]);
printf("%4.1f ",ts);
printf("%4.2f\n",Stell*244.2e-6);

 
how to make how to build counter in 8051 assembly lang

- - - Updated - - -

what is this code for??
and how to get integration and differential in 8051 and tignomretry function as cos sin etc
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top