Jump to content

Talk:Program counter

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Rilak (talk | contribs) at 08:19, 28 October 2008 (Rate as of top importance - the program counter is an essential feature in most CPUs). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing Top‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
TopThis article has been rated as Top-importance on the project's importance scale.
Taskforce icon
This article is supported by Computer hardware task force.

"program counter" is a non-standard misnomer

This thing doesn't count programs. It counts instructions.

Wait, it doesn't count either. It jumps around in response to various events and instructions. IA-32 examples: call, ret, int, syscall, sysenter, sysret, iret...

So it's not a counter. It's a pointer.

Well gee. That must be why Intel called it the instruction pointer in their documentation.

OK, never mind the most popular CPU architecture. What about the Mac or Xbox/360? There we have the next instruction pointer register, and current instruction pointer as a concept in the documentation.

24.110.60.225 00:46, 1 January 2006 (UTC)[reply]

Yes, it counts :-)
The vast majority of instruction fetches are from the next memory location after the previously fetched instruction.
Random-access jumps or branches to other locations are relatively infrequent by comparison.
The PC is a pointer, true, and also a counter
TheAMmollusc (talk) 11:47, 20 October 2008 (UTC)[reply]

instruction pointer disambiguation

I have been reading a bit in my course book about computer hardware and found the following information:

8086/8088 processors have a 16 bit data bus and a 20 bit address bus, so two registers are needed to contain an address: a segment register and an offset register. The memory address can be obtained by bit-shifting the segment register by four bits to the left and performing a summation with the offset register. The memory a program used is seperated into segments. The segment containing the code is called the code segment, and it's segment register is named CS. It's offset register is named IP or instruction pointer.

This information should be added in a page on instruction pointer and a disambiguation page should be made.

--Bernard François 11:39, 6 March 2006 (UTC)[reply]