Postfix Reference Guide

From Wiki**3

Revision as of 23:56, 7 May 2012 by Root (talk | contribs)

The Postfix reference guide contains information about the structure and operations of the stack machine.

The original stack machine was created by Santos (2004). Is was composed by a set of macros to be used with printf functions. Each macro would “take” as arguments, either a number or a string. This was a simple and effective approach but was limited in its expressiveness.

The current postfix code generator class maintains the stack machine abstraction, but does not rely on macros. Instead, it defines an interface to be used by semantic analysers, as defined by a strategy pattern (Gamma et al., 1995). Specific implementations provide the realization of the postfix commands for a particular target machine. Since it is written in C++, it's very easy to extend to new needs and implementations (new target machines).

The following groups of operations are available in the Postfix interface:

directivas

text data rodata  bss align label extrn  globl  const str char id byte double

acesso

addr   addra   addrv   local   loca   locv   load   load2  ldchr store store2 stchr alloc dup swap push  dpush pop dpop int sp

aritmética/lógica

add dadd sub dsub mul dmul div ddiv neg dneg  mod  gt ge  lt le  eq ne  dcmp  d2i  d2f  i2d f2d  incr decr

bit a bit

rotl rotr shtl shtru shtrs and or not xor

funções/saltos

call  ret  start  enter  leave   trash  jmp   jz  jnz  branch leap nil nop