954,490 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

beginner question

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

biran
Newbie Poster
7 posts since Jan 2006
Reputation Points: 10
Solved Threads: 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.

The Guy
Newbie Poster
2 posts since Jun 2008
Reputation Points: 10
Solved Threads: 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

biran
Newbie Poster
7 posts since Jan 2006
Reputation Points: 10
Solved Threads: 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.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

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

a07859
Newbie Poster
6 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

one suggestion, when I was learning assembler then dissasembly from C source function helped me a lot.

darko karamarko
Newbie Poster
1 post since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

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

biran
Newbie Poster
7 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

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

ufg123
Newbie Poster
6 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You