Exemple #1
0
 @Test
 public void testAssembler() {
   Bytes bytes =
       new Assembler(32)
           .assemble(
               "" //
                   + ".org = 0 \n" //
                   + "	JMP (.end) \n" //
                   + "	MOV (AX, 16) \n" //
                   + "	MOV (EAX, 16) \n" //
                   + ".end	() \n" //
                   + "	ADVANCE (16) \n" //
               );
   assertEquals(16, bytes.size());
   System.out.println(bytes);
 }
Exemple #2
0
 @Test
 public void testAssembleLongMode() throws IOException {
   Assembler assembler = new Assembler(32, true);
   Bytes bytes = assembler.assemble(Suite.parse(".org = 0, .l MOV (R9D, DWORD 16),"));
   assertEquals(bytes.size(), 7);
 }