Questions tagged [ijvm]

IJVM is an instruction set architecture created by Andrew Tanenbaum for his MIC-1 architecture. It is used to teach assembly basics in his book Structured Computer Organization.

From the IJVM Wikipedia page:

IJVM is mostly a subset of the JVM assembly language that is used in the Java platform. This instruction set is so simple that it's difficult to write complex programs in it (for example, no shift instructions are provided).

21 questions
3
votes
1 answer

Is it possible to implement a part of a java application directly in jvm?

I was taught about ijvm (a subset of jvm) at my university and it prompted the question: Is it possible to implement a part of a java application directly in jvm for performance improvements? ... In the same way that you can implement a part of a…
Sebastian Nielsen
  • 3,835
  • 5
  • 27
  • 43
3
votes
1 answer

convert an array of bytes into an integer

I'm working on IJVM project using C language. First, I imported a binary file into my program, which should be parsed as words. Now I made a variable (text) which contains the binary and I need to convert it into an array of words. I got a hint …
Appie
  • 55
  • 5
2
votes
1 answer

IJVM is IRETURN equal to HALT ? Because both stopps the interpreter?

I think IRETURN and HALT are the same commend in IJVM. Because I tried both and both stopped the interpreter.
1
vote
1 answer

What is the best approach to implement Local Variable Frame for IJVM?

I'm trying to implement in C an integer java virtual machine taking as example the IJVM described by Andrew Tanenbaum in "Structured Computer Organization" -> IVJM . Until now I was able to execute some instruction such as GOTO, IFEQ, IADD, etc. by…
1
vote
1 answer

How to negate a number in IJVM?

I was thinking of a way to implement a NOT operation/instruction for IJVM so that I could write a multiplication JAS method, but I'm having trouble trying to implement a negation method. Can anyone help out with a way to go about doing this?
1
vote
1 answer

IJVM exercise, swapping 2 elements in a 4 elements stack

i'm trying to create a microprogrammed function that, given 4 values in the stack, swaps the 3rd and the fourth. I called it "mswap", this is the microcode so far: mswap1 SP = SP - 1 mswap2 SP = SP - 1 mswap3 MAR = SP - 1 mswap4 rd mswap5 MAR =…
1
vote
1 answer

Convert code to IJVM

I have translated the code fragment to IJVM, but not sure if it works or not. Tell me whether I am doing it right or not. Or how can I check whether the code works or not. Here is the code. a = 0 sum = x while( a<= x){ sum += a; a++; } Here is…
student
  • 11
  • 1
  • 2
1
vote
1 answer

Carry bit of addition in IJVM

The IADD instruction in IJVM adds two 1-word numbers. When I add EEEEEEEE to itself I get DDDDDDDC. What happens to the carry 1? How can I get it? Is it saved in a register?
0
votes
0 answers

How can I create a IJVM-Code to calculate the factorial of 5?

I have the following problem for which I cannot find a solution: Calculate the factorial n! of a given number n ∈ N. To do this, extend the file fak.jvm by implementing the method fak (without adding further method calls). method calls). You may use…
Jinsel
  • 1
  • 1
0
votes
0 answers

IJVM, what means the numbers next to the method names?

I have the IJVM Simulator I got with the download example code. I don't understand what the numbers next to the methods mean. First example Second example I understand that I am calling the add method above, but then what are those 3 and 1 next to…
0
votes
1 answer

Is it possible to automatically translate Java bytecode to IJVM?

Is it possible to automatically translate Java bytecode to IJVM? Is there any possibility you know?
0
votes
0 answers

Addition and semicolon in assembly language

Can someone explain me what the semicolon do in ADD R1, R1; R2? I know that ADD, addition R1 and R2, and puts the value into R1. Does it do the same here? The first picture is the instruction set we are using. The second picture shows the IJVM…
Wheil
  • 1
  • 4
0
votes
1 answer

wrong size of IJVM chunk file in c question

I am trying to implement an IJVM an read a binary file. I understand that an .ijvm file contains a 32-bit magic number and any number of data blocks and that a data block has three parts. My intention is to first read and store the magic number…
sir Hoyle
  • 7
  • 2
0
votes
0 answers

Need help creating a multiplier using a method in iJVM

I'm trying to create a program in iJVM using a .jas file with a MIC-1 ASSEMBLER to input two numbers by keyboard and multiply them together to get an out put EX: 2*2=4 In the code below I just bipushed random numbers because when i used 'in' to get…
0
votes
0 answers

implementing stack for ijvm instructions JAVA

I am implementing a simple ijvm using a stack in java, however, I encounter a very weird behavior and I have no idea why. So for my stack class I have a constructor public Stack(int maxStacksize) { maxSize = maxStacksize; stack = new…
Milky
  • 153
  • 1
  • 5
1
2