All bytecodes have one explicit operand, at most. However, assembler instructions for some of them seem to allow for one extra argument (see below). Please note that this is only a notation device a way to tell assembler to adjust target address after converting label number or base address into a final offset (stack-, object-, or buffer-relative).
Suppose the Cybiko C compiler sees something like this:
int my_array[ 3 ]; ... my_array[ 2 ] = 1;
Obviously, there is no need to load index, scale it (since array elements are word-sized), then load address of the array, then add it to scaled index, etc. Instead, our compiler will produce something like this:
.label 777 ; my_array .skip 6 ... leag.u 777 4 ; my_array move load1 storeis
Here, 777 is label number (ordinal), 6 is the size of my_array[], and 4 is extra displacement relative to the label 777. Note that assembler will turn 'leag.u 777 4' into a single opcode followed by the word-sized displacement (hence .s suffix).
Note that instruction suffixes designate optional data that may follow (and not the size of the operands):
.c char (that is, signed byte),.b byte (unsigned byte),
.s short (16-bit signed word),
.u unsigned short (16-bit unsigned word),
.w word (16-bit unsigned word),
.l long word (32-bit signed double word).
file: /Techref/cybiko/bc/ops.htm, 1KB, , updated: 2008/6/12 19:33, local time: 2024/11/23 10:49,
18.116.85.204:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/techref/cybiko/bc/ops.htm"> Cybiko Bytecode Interpreter </A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.