flat assembler
Message board for the users of flat assembler.
Index
> Main > sequential mathematics assembly: 
Author 

r22 19 Oct 2009, 16:41
edfed this is silly. You want a "HLL compiler/interpreter" inside of your ASM program? What would be utility / benefit of this?


19 Oct 2009, 16:41 

Borsuc 19 Oct 2009, 17:06
why the hell use parantheses? Use Reverse Polish Notation and get rid of them, at the very least...


19 Oct 2009, 17:06 

edfed 19 Oct 2009, 17:35
ok, for polish notation
but after, i want to do a math interpreter like a command line hit enter, it gives the result like in a TI82 and use it as a feature for my shell. i stil have an interpreter for my own command line functions (paused), and an interpreter for rudimental html, i just want to add an interpret for math formulas. something callable easy. Code: dd f.maths,result,formula formula db 'A+B' result dd ? math must do the interpretation of variables transparentlly. for example, if A is not assigned, it gets the value of "null" and all operation with will be ignored. if A is assigned, all operations with it will be made. 

19 Oct 2009, 17:35 

bitshifter 19 Oct 2009, 19:45
SIMD is the wave of the future.
Ride the wave 

19 Oct 2009, 19:45 

r22 19 Oct 2009, 20:03
Polish notation is more efficient, but parenthesis are easier to use.
@edfed  you need to... 1  break the formula down into a TREE structure where every leaf node is a variable or constant and every junction is an operation. Quote:
2  Create a function for each binary operation (two parameters), don't forget unary operations (one parameter) if you want to support them like NOT, NEG, SQRT. 3  Iterate through your tree in ?breadth first? perform the necessary operation and replace the leaf node(s) and operation node with the operation function's return value. 4  Once you have the basic system working you can optimize it if you'd like. Using multiple threads to evaluate operations that are on the same TREE LEVEL (i.e. they are not dependent on eachother). Trying to optimize the TREE by simplifying the formula etc etc. 

19 Oct 2009, 20:03 

< Last Thread  Next Thread > 
Forum Rules:

Copyright © 19992024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.