News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

I need code for expression calculation

Started by secretworld, 23:42, 18 May 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

secretworld

I am in stack friends.Please help me .I need a code in x86 assembly language of expression calculation.

Suppose i want to calculate (4*(5+1)) types of expressions.The output will be just result.

I am in beginner stage.Here are many assembler programmers.So,Please help me by mailing me the source code.
I need the code within 20 may,2010.

Please help me.

fano

Do you homework yourself , it is not helping to give you the solution  :police:
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Gryzor

What? And this is related to CPC how...? Tsk, tsk, cheaters...

Devilmarkus

Come on guys.
He's from Bangladesh ;)
Have mercy.
MOV AX, 40 
ADD AX, 1 
MOV BX, 20 
MUL BX
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

arnoldemu

Quote from: secretworld on 23:42, 18 May 10
I am in stack friends.Please help me .I need a code in x86 assembly language of expression calculation.

Suppose i want to calculate (4*(5+1)) types of expressions.The output will be just result.

I am in beginner stage.Here are many assembler programmers.So,Please help me by mailing me the source code.
I need the code within 20 may,2010.

Please help me.

Some words to help you. Look in google, but I can't help with the asm code.

postfix
reverse polish
stack based calculator

take the input calculation, re-order it using reverse polish notation. then use a stack based calculator method to generate result.

Well I have given you the answer without the x86 asm code.

BTW, the Amstrad CPC which this forum is about, never had an x86 in it. Only a z80. You need to ask in another forum ;)
I hope the weather is ok in Bangladesh, here it is sunny, with a few rain clouds in the sky.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

fano

Quote from: Devilmarkus on 08:52, 19 May 10
Come on guys.
He's from Bangladesh ;)
Have mercy.
MOV AX, 40 
ADD AX, 1 
MOV BX, 20 
MUL BX

As he said stack based , i'd think it is FPU calculation , something like :


FLD 4
FLD 1
FLD 5
FADDP ;(5+1)
FMULP ;*4

Result is in ST(0) (forget what i said , i can not resist  :laugh: )
"NOP" is the perfect program : short , fast and (known) bug free

Follow Easter Egg products on Facebook !

Gryzor

Was the CPC imported to Bangladesh? That's what I'm curious about.

Powered by SMFPacks Menu Editor Mod