tnode.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. Notes:
  2. lexpr is LHS sub-expression.
  3. rexpr is RHS sub-expression.
  4. iconst is generic int value.
  5. sconst is generic string value
  6. LABEL(sconst)
  7. generate code label
  8. JUMP(sconst)
  9. jump to global sconst
  10. JUMPT(lexpr,sconst)
  11. jump to sconst if INT lexpr<>0
  12. JUMPF(lexpr,sconst)
  13. jump to sconst if INT lexpr==0
  14. JUMPGE(lexpr,rexpr,sconst)
  15. jump to sconst if INT lexpr>=INT rexpr
  16. SEQ(lexpr,rexpr)
  17. execute lexpr, rexpr in any order. results not used.
  18. MOVE(lexpr,rexpr)
  19. move lexpr to rexpr. rexpr always a MEM.
  20. MEM(lexpr)
  21. contents of mem in lexpr - except for RHS of MOVE.
  22. LOCAL(iconst)
  23. address of local var at offset iconst
  24. GLOBAL(sconst)
  25. address of global var at sconst
  26. ARG(iconst)
  27. address of argument var at offset iconst
  28. CONST(iconst)
  29. constant
  30. CALL(lexpr,rexpr,iconst)
  31. create argframe of size iconst. eval rexpr and discard result.
  32. call address in lexpr. destroy argframe.
  33. RETURN(lexpr,sconst)
  34. eval INT lexpr into int return reg and jump to sconst
  35. CAST(lexpr)
  36. convert FP lexpr to INT.
  37. NEG,NOT,
  38. INT unary expressions. lexpr always int. result int.
  39. AND,OR,EOR,SHL,SHR,ASR,ADD,SUB,MUL,DIV
  40. INT binary expressions. lexpr and rexpr always int. result int.
  41. SETEQ,SETNE,SETLT,SETGT,SETLE,SETGE
  42. INT releational expressions. result '1' if INT lexpr,rexpr comparison
  43. true else '0'.
  44. FCALL
  45. like CALL but result is in FP return reg.
  46. FRETURN(lexpr)
  47. like RETURN, but put result into FP return reg. lexpr always FP.
  48. FCAST(lexpr)
  49. convert INT lexpr to FP.
  50. FNEG
  51. FP unary operators. lexpr always FP, result FP.
  52. FADD,FSUB,FMUL,FDIV,
  53. FP binary operators. lexpr, rexpr always FP, result FP
  54. FSETEQ,FSETNE,FSETLT,FSETGT,FSETLE,FSETGE,
  55. FP relational operators. lexpr, rexpr always FP. result INT!