This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
CAHomework/Homework 9/ijvm.conf

27 lines
1.4 KiB
Plaintext

// configuration file for IJVM Assembler
0x10 BIPUSH byte // Push byte onto stack
0x59 DUP // Copy top word on stack; push onto stack
0xA7 GOTO label // Unconditional jump
0x60 IADD // Pop two words from stack; push their sum
0x7E IAND // Pop two words from stack; push Boolean AND
0x99 IFEQ label // Pop word from stack; branch if it is zero
0x9B IFLT label // Pop word from stack; branch if it is less than zero
0x9F IF_ICMPEQ label // Pop two words from stack; branch if equal
0x84 IINC varnum const // Add a constant to a local variable
0x15 ILOAD varnum // Push local variable onto stack
0xB6 INVOKEVIRTUAL offset // Invoke a method
0xB0 IOR // Pop two words from stack; push Boolean OR
0xAC IRETURN // Return from method with integer value
0x36 ISTORE varnum // Pop word from stack; store in local variable
0x64 ISUB // Pop two words from stack; push their difference
0x13 LDC_W index // Push constant from constant pool onto stack
0x00 NOP // Do nothing
0x57 POP // Delete word on top of stack
0x5F SWAP // Swap the two top words on the stack
0xC4 WIDE // Prefix instruction; next instruction has 16-bit index
0xFF HALT // halt the simulator
0xFE ERR // print ERROR and halt
0xFD OUT // Pop a word from the stack and use the low order 8-bits as an ASCI character to display on screen
0xFC IN // Read a character from standard input and put it in the low order 8-bits of a word pushed onto the stack
0x42 JIFEVEN label