What are these specific purpose registers?

Asked

Viewed 780 times

2

I’m following a book about Computer Architecture and I’m on the register side, but it doesn’t contain any practical examples of how

Registers of Specific Purpose.

Among them are:

PC (Program Control) -> Has the address and search the next instruction to be searched

GO (Instruction Register) Save the Instruction and pass to the UCD

SEA (Memory Adress Register) Works when the data is in memory and not in the recorder

MBR (Memory Buffer Register, alias this has something to do with the buffer that we see in programming?) Response of Memory is recorded in MBR

How these above recorders work when we are coding?

The general purpose recorders are what we keep variables so the clear example already comes close to my mind, but the general purpose approach is quite different...

var x = 10 //Seria isso?
  • 1

    In memory these data types are stored: 4(Curt) or 8(long) bytes, float, double, array of bytes, bits, string. For the variable you gave example is 4 bytes.

  • I’m sorry for the ignorance, but I don’t really understand what you’re referring to in the question...

  • I talked about variable data type.

  • 1

    Each IC architecture implements the registers differently. In the book it is explaining in a generic way. And no, the variables of your C program are not stored in the general-purpose registers, they are stored in the RAM, but on the way from the input to the RAM storage the information will certainly travel by registers. Yes registers work analogous to variables, but the scope of their use is intrinsic and restricted to micro operations that are the blocks that form the instructions of the programming languages.

  • @Augustovasques didn’t know how this whole process works, he thought it would go straight to the register (very strange thing, because I learned from an early age that things would go to RAM memory), because it doesn’t say anything about RAM (until the chapter where I read and I was in doubt). Even so, thank you for the explanation. About the IC architectures have some site informing the most famous or all?

  • I think what you’re looking for are the manufacturers' manuals. http://home.ifi.uio.no/...IA32Doc/ These are all the manuals of the IA-32(x86) architecture, are in English and are available for free on the Intel website, only that this is a zone and it would take me a long time to make the query, so I preferred to pass this link

Show 1 more comment

2 answers

4


I would start reading How a computer understands binary code?.

PC - is the registrar used to determine which address it should run next. Every executed instruction makes it move to the next instruction. In RISC processors it is easy because all instructions are the same size and the increment is easy, in CISC processors you need to find the size in an internal table and increment that. It only points to regions of memory that have code and not data. It can be manipulated by a code when there is some branch in your code, either by a if, whileougoto` simple, ie, your code can manipulate it.

GO - generally more internal use has the instruction to be executed, is a kind of cache and is usually only present in RISC processors that performs an instruction in several cycles and needs a greater control of what is occurring.

SEA - It is also usually internal and indicates where a data is to be transferred to or from the processor. It is usually necessary for data transport operations. It is usually used when accessing or assigning values to a variable, as shown in the question.

MBR - also used to be internal and used as a kind of cache to store the data that will be transferred, this is useful because the processor may be running another instruction while this transfer takes place.

Only the PC is useful for those who are programming, and even if using Assembly.

Variables are design standards for access to addresses that can be RAM or a register (contrary to what the other answer says). It is extremely common for an Assembly programmer to use registers as their variables and the minimally good compilers put as many local variables and parameters as they can into registers.

  • Great answer, but all this at the time we’re programming, does knowing this make a difference these days? You said "Only the PC is useful to those who are programming, and even if they are using Assembly." out of this context so it is not so useful to know this subject. I’m sorry for the ignorance, I’m learning now and I’m focused on that.

  • 3

    Not in normal programming, but it is good to have basic understanding of what happens on the machine when programming, even to know what actually happens in that code. It’s important to understand the whole. This is a step to build knowledge, something that the greatest of people no longer know how to do and do not care to know only enough to see the result.

1

Dude, each of these recorders has a purpose in memory management, in the description of each one it already says what they are, to see in practice you can find illustrative images on the internet, to work directly with them, you need to know how each type of architecture(ex:MIPS,x86) works.

With Assembly language or one that has privileged access to memory, you will be able to manipulate these registers.

Example of a code in Assembly, using data loggers and processing:

section .text

       global _start     ;must be declared for linker (gcc)

    _start:          ;tell linker entry point
       mov  edx,len  ;message length
       mov  ecx,msg  ;message to write
       mov  ebx,1    ;file descriptor (stdout)
       mov  eax,4    ;system call number (sys_write)
       int  0x80     ;call kernel

       mov  edx,9    ;message length
       mov  ecx,s2   ;message to write
       mov  ebx,1    ;file descriptor (stdout)
       mov  eax,4    ;system call number (sys_write)
       int  0x80     ;call kernel

       mov  eax,1    ;system call number (sys_exit)
       int  0x80     ;call kernel

    section .data
    msg db 'Displaying 9 stars',0xa ;a message
    len equ $ - msg  ;length of message
    s2 times 9 db '*'

eax, edx, ecx, etc.; are registers.

  • Opa, thanks for the explanation and the demonstrative code, I’m starting in this part of architecture to know what I’ll be doing further when building my codes, and how to improve etc... Besides, I like to know how it works under the table.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.