Calculates the first derivative of a simple polynomial

kasparov

Joined Nov 19, 2011
3
Hello All,

I am new to this 8086 assembly language. I have to take user input showing message "Enter polynomial:" which further takes some input according to value entered for polynomial in loop and stored in array.
IS any one tell me how can I do?

Best Regards,

kubeek

Joined Sep 20, 2005
5,796
value entered for polynomial in loop and stored in array
8086 is nice, but is that processor inside a PC-compatible device?
Assuming yes, and using bios functions, you would enter the polynomial from the low-power side, so that 5x^3-3x^2+2x+1 would be entered as
1(enter)
2(enter)
-3(enter)
5(enter)(enter)
You need to decide on how do you tell that you input the last digit (could be the two enters in a row). You also need to be able to parse the numbers, so start with n=0; n=n*10+next_digit_entered and loop this until you read enter, also watch out for the minus in the beginning.
Store all the coefficients in memory and then calculate the derivative.

kasparov

Joined Nov 19, 2011
3
It is easy to in any other language like Java or C, but I don't know how to do in 8086?
Can you show me by some example. I mean, how can I store all input value in an array and how can retrieve later and so on.

kubeek

Joined Sep 20, 2005
5,796
There's no arrays in 8086. You just have big chunk of memory addresses and place the data anywhere you like (except the video ram and the data segment of your programme, off course ). It's been long time since I last wrote intel assembler, but I think you just choose an address, store the byte, then increment it, then store.....