Copyright (C) 2001 Michael Leonhard Mike Leonhard mike at tamale dot net http://tamale.net/ Sebae Assembly v1 draft The Sebae Assembly language closely mirrors the format of Sebae bytecode files. Code in an assembly file is divided up into sections. These sections are called defns and correspond directly to the Sebae bytecode defns. Sebae bytecode defns are assigned an id based on their order of appearance the bytecode file. Assembly defns are also assigned an id by their order of appearance in the assembly file. The first defn has an id of 1, the second is 2, and so on. Assembly directives are terminated by the `;' character. Comments may be inserted into the assembly file. A comment begins with two `/' characters and extends to a `\r' or `\n' character. Comments may occur anywhere in the file. Comments are ignored along with the ` ', `\r', `\n', and `\t' characters. Sebae Assembly directives: DATA "filename"; The DATA directive is optional. If it is present then it must appear as the last directive in the file. The data block for the bytecode program will be loaded from the specified file. The specified filename must be quoted with the `"' character. If the DATA directive is absent, the program will have an empty data block. DEFN consume produce Begins a code defn. The consume and produce values are positive integers which specify the number of stack elements which the defn will consume and produce. A defn extends till it reaches a defn-terminal instruction, HALT or JUMP. The assembly sources must contain at least one valid defn specification. Sebae instructions are followed by a semicolon. Here is a list of the instructions. Details may be found in bytecode.txt. HALT; JUMP element1; LOADCODE element1; VECTOR; PUSH integer/float; POP; ASSIGN element1 element2; STACKSIZE; STACKHEIGHT; ADD element1 element2; FPADD element1 element2; SUBTRACT element1 element2; FPSUBTRACT element1 element2; MULTIPLY element1 element2; FPMULTIPLY element1 element2; DIVIDE element1 element2; FPDIVIDE element1 element2; REMAINDER element1 element2; FPREMAINDER element1 element2; GREATERTHAN element1 element2; FPGREATERTHAN element1 element2; AND element1 element2; OR element1 element2; XOR element1 element2; ROTATE element1 element2; EQUAL element1 element2; DECIDE element1 element2 element3; LOAD element1 element2; SAVE element1 element2; MEMSIZE;