Questions tagged [instructions]

Questions about instructions of real CPUs, VMs or compiler IRs.

Questions about instructions of real CPUs such as ARM and x86, virtual machines such as Java, or compiler internal representations such as LLVM.

574 questions
-1
votes
1 answer

What is the difference between "instruction" and "operation" terms?

Definitions: Instruction is just atomic parts of assembly language like MOV EAX, EBX Now let's say we have the following code written in C++ language: int a = 1; int b = a + 3; Here = and + are operators. In mathematics, an operation is a…
No Name QA
  • 724
  • 1
  • 6
  • 20
-1
votes
1 answer

How to execute ARM binary instructions?

let's say I have a file full of ARM processor instructions which are already represented as bytes. What is the best way to execute them directly with qemu-arm? Thanks!
-1
votes
1 answer

load 32 bit immediate value in RISCV memory

I am trying to store a 32 bit immediate value in a riscv memory location.The corresponding code is lui x13,0x12345 addi x13,x13,0x678 // 32 bit value- 12345678 lui x11, 0x1c010 // address location 1c01000 sw x13,x11 The problem I am facing is…
RISCV
  • 15
  • 6
-1
votes
1 answer

What about the MIPS instructions is correct?

In which of the above instructions is done writing in a register? a) lw b) bne c) beq d) sll e) sw f) add I'm sure for d) and f) but I also think that a) and e) are correct. What do you think?
Viktor
  • 5
  • 3
-1
votes
1 answer

fetch and decode instruction located at X address with c

I want to fetch and decode a instruction at address X. After that I want to increment the address by 4 and then execute the decoded instruction. The registers are 32 bit big endian. I am not asking for a solution, more a pointer or tips on how to do…
user123
  • 13
  • 3
-1
votes
3 answers

Wasting cycles with actual arbitrary instructions with Python

I have been working on a project in which I need to create a Python application that wastes instructions & cycles at this stage. Normally when 'cycle wasting' means waiting or sleeping; but I want to do it in a different manner. There should be some…
mozcelikors
  • 2,582
  • 8
  • 43
  • 77
-1
votes
1 answer

How many instructions could fit into a 256 byte memory unit, given a 32-bit architecture?

How many instructions could fit into a 256-byte memory unit, given a 32-bit architecture? Could someone explain how you get this answer? I know each instruction is 32 bits. I know the answer is 9 but I don't know how to get that answer 1…
-1
votes
1 answer

Segmentation fault (core dumped) neural network

I have a 3-layed neural network, and I'm getting a seg fault. I know that means I'm writing to the wrong memory space. In this scenario I would guess it is because I am running out of space. The thing is I have calloced all of my large store items,…
-1
votes
1 answer

Decode a word instruction in java

I'm trying to to write a program that simulates a virtual machine in Java for an assignment. It will be a register-based VM that will, obviously, store and execute numerous instructions. I'm having a problem with how to decode the machine…
-1
votes
1 answer

Dont I Have SCAS or CMPS in emu8086?

I write a short function which need this instruction. Dont I have these in EMU8086?
user3590450
  • 463
  • 1
  • 6
  • 13
-1
votes
1 answer

Why is modification of the program counter not a privileged instruction?

The program counter is stored in the PCB and that is in the kernel space. But modifying the program counter is not a privileged instruction. Why is that?
Sanke
  • 676
  • 2
  • 13
  • 30
-1
votes
2 answers

LC3 assembly program, print instruction

The following LC3 program will print out "Hello". But can some one please help to explain why it does it? I am confused because there is no instructions like PUTS. Does it have something to do with loading values to R0? Thank you! LEA R1,…
user3474606
  • 515
  • 1
  • 6
  • 15
-1
votes
4 answers

What if we want to load more instructions than the number of registers available at a time...?

I am referring to NASM. There are some standard registers in which we load instructions before calling the kernel. I wanted to know if at some point we want to load more instructions than the number of registers available then what should we…
user3387108
-1
votes
1 answer

java bytecode deterministic instructions

I need to find automatically all instructions in java bytecode that are executed for sure. An analog example in pseudocode: x=a; //will be executed for sure y=b; //will be executed for sure if(x>y) //will be executed for sure x++; //might not be…
-1
votes
1 answer

How to build own instructions for command line

I had experienced Windows command line as well as Linux based. I curious how to build my own instructions for windows.
user3138965
  • 129
  • 5
  • 13