artefaktur
software engineer &        architecture

 
 
 
 

AAL OpCode Expressions

| Expressions | Statements | Class | DMI Interface |

Intermediate OpCode for AAL.

Content of this chapter:

   Basics
   Topics
     Operators
     Short circuit boolean evaluation

 Basics

Expression are evaluated to a resulting value, which should be on top of stack after execution.

 Topics

 Operators

id1 + id2
whereas id1/id2 can be an basic type or an Object. If both ids are basic types build in operator should be used. Otherwise an matching operator should be found.
load [id1]
load [id2]
add

or
load [id2] // argument
load [id1] // object
push "operator_pl"
push 1 // number of args and flags
invoke

 Short circuit boolean evaluation

i < 9 && i > 0
If the first part of the expression i < 9 the second part of the logical expression should not be evaluated.
load [i]
push 9
lt
brfalse endofexpr // false is on TOS
pop               // TOS=true not further needed
load [i]
push 0
gt    // result is on TOS
:endofexpr

 
Last modified 2005-05-08 22:35 by SYSTEM By Artefaktur, Ing. Bureau Kommer