Difference between a read and load

7,340

Solution 1

read is usually associated reading data from a permanent storage (HDD, USB Stick etc.).
load on the other hand is loading data you have previously read from RAM into a CPU register/accumulator (Assembly command lda).

The same goes for write, which means writing data to a permanent storage. And store, which stores values of a register/accumulator to a variable in RAM to save its value.

Solution 2

What is the major difference between and read and load and a write and store?

An answer is complicated because these words could be used as jargon as well as used in a conventional manner in a technical document. Even as jargon the meanings of these verbs can depend on the context of their use.

A key concept is that the direction of data transfers within a computer are (almost) always relative to the CPU. An input is a data transfer directed towards the CPU. An output is a data transfer directed away from the CPU.

The differences of read versus load and write versus store relate primarily to the object of the action. The object of a read is the source of the data transfer (e.g. you read (from) memory or read (from) a device register or read a book). "Read into memory" is awkward grammar/semantics. The object of a load is the destination of the data transfer (e.g. you load a register or load (into) memory or load a cart). Both read and load can be input operations, but read focuses on the source of that input whereas load focuses on the destination of that transfer.

Similarly the object of a write is the destination of the data transfer (e.g. you write (to) memory or write (to) a device register). "Write from memory" does not make sense. The object of a store is the source of the data transfer (e.g. you store a register). Both write and store can be output operations, but write focuses on the destination of that output whereas store focuses on the source of that transfer.

Of course the object of the verbs read/load/write/store could also be the data itself, e.g. read a variable from RAM or load a program into memory. This construct applies to all four verbs, so it's not a difference.

Another concept is that of "destruction". My first programming teacher drilled into me that "reads are non-destructive, and writes are destructive". He was referring to reading (from) and writing (to) program variables (in memory). Reading from a variable leaves its value intact. Writing to a variable destroys its previous value.

Reads and stores are typically non-destructive; the contents of the source are not modified. However there are computers that have registers that are cleared when read/stored, and memory locations that increment (or decrement) the contents when read. Loads and writes, to make sense, have to be destructive; the data transferred is expected to replace the prior contents at the destination.

Share:
7,340

Related videos on Youtube

Ankur Bhatia
Author by

Ankur Bhatia

Updated on September 18, 2022

Comments

  • Ankur Bhatia
    Ankur Bhatia over 1 year

    What is the major difference between read and load and write and store?

    I know it is a very basic question, but somehow I'm not able to get it.

  • sawdust
    sawdust almost 9 years
    Read and write are not restricted to "permanent storage". You can read and write a peripheral's control registers (which are volatile) as well as read/write RAM.
  • GiantTree
    GiantTree almost 9 years
    @sawdust this is why have written "usually". I know you can read from any data source (all inputstreams) and write to any data output (all outputstreams).
  • Peter Cordes
    Peter Cordes over 6 years
    In computer-architecture (CPU design) terminology, it's common to mix load / read almost interchangeably. I think you might be on to something in your last 2 paragraphs about load being about the destination register, and read being about the memory source, though. We talk about cache or register-file read/write ports (built into CPU's fast internal storage arrays), but we also talk about load/store execution units (connected to the store-source / load-destination side of thing). e.g. realworldtech.com/haswell-cpu/5