Assembly Language: Loading Data from Memory, Study notes of Programming Languages

These review notes from cpsc 3121, summer 2008 cover the process of loading data from memory using various assembly language commands, including 'la' and 'l' for loading fullwords (32-bit values) and halfwords (16-bit values). The notes explain the concept of an assembler address and its relation to an array index, as well as the difference between loading the address and loading the contents of the address.

Typology: Study notes

Pre 2010

Uploaded on 08/04/2009

koofers-user-wvb
koofers-user-wvb 🇺🇸

3

(1)

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CPSC 3121 Summer 2008
Review Notes July 10
LA R2,SAVEAREA
Loads the address SAVEAREA into register 2
L R2,SAVEAREA
Loads the four byte number at address SAVEAREA into R2.
This is the contents of the address, not the address.
The L command is a “Load Fullword”, so it gets
32 bits or 4 bytes.
The bytes loaded are from addresses
SAVEAREA
SAVEAREA+1
SAVEAREA+2
SAVEAREA+3
pf2

Partial preview of the text

Download Assembly Language: Loading Data from Memory and more Study notes Programming Languages in PDF only on Docsity!

CPSC 3121 Summer 2008

Review Notes July 10

LA R2,SAVEAREA

Loads the address SAVEAREA into register 2 L R2,SAVEAREA Loads the four byte number at address SAVEAREA into R2. This is the contents of the address, not the address. The L command is a “Load Fullword”, so it gets 32 bits or 4 bytes. The bytes loaded are from addresses SAVEAREA SAVEAREA+ SAVEAREA+ SAVEAREA+

LH R2,SAVEAREA

Loads the two byte number at address SAVEAREA into R2. This is the contents of the address, not the address. The L command is a “Load Halfword”, so it gets 16 bits or 2 bytes. The bytes loaded are from addresses SAVEAREA SAVEAREA+ Think of an array declared as Type Array[Length] The assembler address is similar to the index of the array The assembler contents is similar to the contents of the array entry.