Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

19
LINES

< > BotCompany Repo | #1003140 // Assembly Machine Test Cases

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1038L/7K/25K).

!752

!include #1003139 // Assembly Machine

static final int startAddress = 100;

p {
  testProgram(new int[] { op_return });
  testProgram(new int[] { op_nop });
  testProgram(new int[] { op_set, 123, 0 }, 0, 123);
  testProgram(new int[] { op_set, 123, 3, op_add_im, 3, 333 }, 3, 456);
  testProgram(new int[] { op_jump_rel, 3, op_illegal, op_set, 123, 0 }, 0, 123);
}

static void testProgram(int[] program, int... values) {
  new Grid g;
  g.set(startAddress, program);
  testProgram(g, startAddress, values);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003140
Snippet name: Assembly Machine Test Cases
Eternal ID of this version: #1003140/1
Text MD5: 6473fbdc2dcbccc6f41033c5f60b66a0
Transpilation MD5: 431ccbc1c59c21fb651448c245d19829
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-05-14 01:33:30
Source code size: 536 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 604 / 706
Referenced in: [show references]