0

Dear sir,
i am really beginner of assembly low level language. so, please help me.
how to program this example.
program to evaluates 4*(x^2)+3x+7 if flag==1 or evaluates 9x+3 if flag==0. assume x is a 16 bits unsigned integer.

waiting your prompt.
bir

6
Contributors
7
Replies
8
Views
9 Years
Discussion Span
Last Post by ufg123
0

Use Switch fucntion if you are using C.

I don't think we are to help with your homework unless you actually try something yourself.

0

Sir, i am not doing my home work, please try understand. actually i want to learn assembly language. im not talking about c programing! i can do that in c programing. my question is depend on low level assembly language.
anyway thank you for your answer.

reagrds

0

So which ops are confusing you?
addition, multiply?

You should at least be able to string a few instructions together to attempt one of the expressions.

0

Dear sir,
i am really beginner of assembly low level language. so, please help me.
how to program this example.
program to evaluates 4*(x^2)+3x+7 if flag==1 or evaluates 9x+3 if flag==0. assume x is a 16 bits unsigned integer.

waiting your prompt.
bir

mov flag,cl
cmp cl,1
jne a
mov ax,x
push ax
mul ax //x^2
mul 4 //4*(x^2)
pop bx
push ax
mov ax,bx
mul 3 (3x)
push bx // bx=4*(x^2)
add ax,bx
add ax,7
jmp end
a:
mov ax,x
mul 9
add,ax,3

0

Anyway Thank you very much for example source code.
thank you

0

I am also beginner. I want to no how to start learning assembly leagues.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.