proj-oot-old-150618-ootAssemblyOpsNotes1

fns

APPLY (same as GET?)

sync and time

WAIT (block until something is done) NOP SLEEP

data misc

PERSPECTIVE/VIEW GETTABLE? SETTABLE?

feature negotiation

CPUID -- args in reg, first call CPUID(0) to get highest arg supported: http://en.m.wikipedia.org/wiki/CPUID, vendor id, processor id, feature bits, serial number, core topology, cache config, virtual and physical address sizes

graph regex

MATCH REPLACE FILL-IN-TEMPLATE (like python's '%' on strings, but with graphs)

types

VARTYPE (but with our 'type attributes' this is just a set of attrs, right?) ZEROOFTYPE (get the 'zero' or default member of a type) ISA ISSUBTYPE (is <= in types; mb just use <= tho)

allocs

UNDEF (done with the contents of this register) ENTER, LEAVE (enter and leave block scopes; something similar may be/seems to be present in Ruby YARV bytecode and Perl55555) MALLOC, MEMFREE GENSYM (see below) ISDEFINED

copies and moves

SHALLOWCPY (shallow copy) DEEPCPY (deep copy) COW (copy-on-write) MOV (shallowcopy and promise never to use old one)

aliases

ALIAS, GETALIAS (see [1])

attribute access

GET SET DIRECTGET, DIRECTSET (non-indirection versions of array indexing; take the array stride as arguments; 1d arrays only?) (or, just GET and SET with modalities, but that would decrease code density)

objects

PUTSELF (both Lua and Ruby Yarv appear to have an instruction to reference Self/This DEFINEMETHOD DEFINECLASS SEND INVOKESUPER INVOKEBLOCK APPEND_METHOD_TO_INSTANCE (YARV's opt_ltlt)

loops

FINISH (YARV; return from this vm loop)

jumps

JMP (like assembly JMP or basic GOTO; like http://llvm.org/docs/LangRef.html#br-instruction unconditional form)

(note; JMP's argument can be a label; this makes it a 'computed goto', like http://llvm.org/docs/LangRef.html#indirectbr-instruction ; but either you must explicitly provide all possible labels, or all labels in the fn (or module?!?) will be assumed to be possible; note that this implies that labels are first-class (are values that can be held in variables))

conditionals

SWITCH (like HLL switch or like http://llvm.org/docs/LangRef.html#switch-instruction but mb more general if boolean expressions in the conditionals) IF (like HLL IF or like http://llvm.org/docs/LangRef.html#br-instruction conditional form)

misc control

phi (like http://llvm.org/docs/LangRef.html#phi-instruction )

address spaces

probably don't need ops for these but some languages have them:

LOCAL GLOBAL UPVARIABLES (also enclosing LEXICAL) CONSTANTS DYNAMIC (semiglobals) ALIAS/SYMLINKS SPECIAL INSTANCEVARS CLASSVARS

and special constants and literals: PUTNIL PUTSELF PUTOBJECT (YARV) PUTSTRING (YARV)

errors and exceptions

DEFER (golang-style) THROW/RAISE TRY (? isnt this a lexical thing?) CATCH (? isnt this a lexical thing?) FINALLY (? isnt this a lexical thing?)

non-primitive control

SWITCH

interop

CALL_C_FUNCTION

debugging

TRACE


ordinary fns

stacks

PUSH POP DUP DUPN SWAP REPUT (YARV; ?) STACKGETN (YARV topn) STACKSETN (YARV setn) EMPTYSTACK n (YARV adjuststack)

strings

STRSCONCAT n (n strings)

arithmetic

ADD SUB MUL DIV MAC (multiply-and-accumulate) INC DEC MOD REM

bit shifts

LSL LSR ASL ASR ROL ROR ROLC (rotate left thru carry) RORC (rotate right thru carry)

bit ops

TESTBIT SETBIT

boolean expressions

STRUCT-EQ PTR-EQ LT LTE GT GTE AND OR NOT XOR

coercion

tostr toregexp

arrays

newarray duparray expandarray (YARV) concatarray (YARV) splatarray; play array contents onto the stack (YARV splatarray?) unsplatarray; play stack contents into an array ismemberofarray (YARV's checkincludearray) arrayany (like ismemberofarray True; YARV's checkincludearray with flag set) aref aset length

hashs

newhash

ranges

newrange; create a Range object (YARV) splatrange put a range onto the stack


todo

stuff about grammars (parsing and producing?) stuff about logic oberon stuff (while loops, etc)? lua ethereum