Questions tagged [program-counter]

The program counter (PC), commonly called the instruction pointer (IP) in Intel x86 and Itanium microprocessors, and sometimes called the instruction address register (IAR), the instruction counter, or just part of the instruction sequencer, is a processor register that indicates where a computer is in its program sequence.

The program counter (PC), commonly called the instruction pointer (IP) in Intel x86 and Itanium microprocessors, and sometimes called the instruction address register (IAR), the instruction counter, or just part of the instruction sequencer, is a processor register that indicates where a computer is in its program sequence.

105 questions
0
votes
2 answers

Address in Program Counter Register

We know that the Program Counter contains the address of the next instruction to be executed. I am trying to understand which address this is - logical (CPU) or physical (RAM).
0
votes
1 answer

Comp Architecture - LC-3

I was wondering what the PC (Program Counter) has to do with the condition codes? I noticed that when the PC was introduced, it had ", condition codes" right after. I know what the condition codes do but not sure how they're related.
0
votes
2 answers

What is the difference between Program Status Word (PSW) and Program Counter (PC)?

In an Operating Systems course, the instructor introduced PSW and PC when he talked about Interrupt Handling. His explanation was PC holds the address of the next instruction to be fetched PSW contains execution status information But later I…
0
votes
1 answer

Why Program Counter in RISC V should be added by 4 instead of adding 0 or 2

Why PC in RISC V architecture connect with PC+4 instead of PC+2 or PC+1. I think it depend on the width of memory cell of the Instruction Memory (IMEM). If the width is 16 bits, then we need to load two adjacent addresses to fill 32 bits instruction…
Khoa Trần
  • 15
  • 2
  • 4
0
votes
1 answer

How is value of Program Counter incremented?

I am creating a Primitive Virtual Machine which is kind of inspired by LC-3 VMs but a 32-bit version. I am feeding the machine set of instructions. After executing the first instruction, how will the PC know the location of the second…
0
votes
2 answers

Reset of PCH when adding a value to PCL using addwf pic18f2x

I'm trying to use simple lookup tables in assembly by adding a certain index to the program counter. It appears to be working in a range of the PCL (so until 0xff) but afterwards, when the PCH comes in to play the PCH just resets after the addwf…
0
votes
0 answers

Where does %rip register point?

I'm studying assembly, and I wonder where does %rip point when a instruction is being executed. For example, 0x123456 call %eip+0x210 0x123459 movl %eax, %edx In this code, when assembler reaches 0x123456, the address 0x123456 will be…
AABBCC
  • 77
  • 2
  • 8
0
votes
1 answer

What does the PC register point to after fetch is completed?

What does the PC register point to after fetch is completed? Is it the address of the next instruction to be executed, or something else?
user366312
  • 16,949
  • 65
  • 235
  • 452
0
votes
0 answers

I need to know how to make a proper 4 bit binary counter

I tried making a 4 bit binary counter from the following picture: As the result of making that circuit in a game with no flip-flops or anything with are intended with blocks I was confused on the following: where is the output? does the clock…
0
votes
1 answer

Access scheduled instructions of process in kernel module

I want to write a kernel module that inspects the scheduled instructions of a running process. I already had a look at Linux Kernel Process Management, which explains how to iterate over processes. struct task_struct *task; for_each_process(task) { …
arne.z
  • 3,242
  • 3
  • 24
  • 46
0
votes
0 answers

ARM Assembly - Factorial Recursion Program Counter out of valid memory range

Hello I am very new to writing assembly and have a question regarding my attempt at writing a recursive function to compute the factorial of n. Here is my attempt at writing the factorial function: .global main main: MOV r1,…
Biggytiny
  • 519
  • 10
  • 29
0
votes
0 answers

How to continue a thread's work from another thread?

I have two threads (in C) that execute the following instructions: void Foo() { // function running in thread 1 1| head = NULL; 2| tail = NULL; } and void Bar() { // function running in thread 2 1| mid = mid-next; 2| tail =…
Tamas Ionut
  • 4,240
  • 5
  • 36
  • 59
0
votes
1 answer

Pthread Program Counter

Using pthreads for C, is there a way to access the program counter/instruction pointer for specific threads? Example: void *thread_main(void *arg) { long thread = (long)arg; lock (thread); ***print (thread.pc);*** critical_section…
0
votes
2 answers

Signal becomes 0X00 from 0100

I am working on a Program Counter that must be added 4 in each rising edge of a clk: Code: if_CounterSum <= MemAddr + 4; process (Clk, Reset) begin if Reset = '1' then MemAddr <= (OTHERS => '0'); elsif rising_edge(Clk) then …
0Zero0
  • 43
  • 7
0
votes
1 answer

verilog program counter syntax error

So I'm getting a syntax error for my program counter test bench and I can not figure out why I keep getting Following verilog source has syntax error: "pc_tb.v", 20: token is 'initial' initial ^ Am i using initial wrong? Making a pipelined…
Nuf
  • 1
  • 4