The purpose of the CS255 course is:
|
Therefore:
|
BTW, the complete list of GNU assembler directives are in this online document: click here
You can see it's a very long list and I don't have to time to cover it all !!!
|
.text // Tell the assmbler to put the lines that follows .text in the text segment // I.e.: the lines that follows .text will considered as assembler instructions |
Example: see the hello.s program in the webpage: click here
.data // Tell the assmbler to put the lines that follows .data in the data segment // I.e.: treat these lines as variable definitions |
Example: see the string data defined in after .data in the hello.s program in the webpage: click here
Note:
|
|
Examples of identifiers:
radius pi X x _X |
|
As you recall, a location in memory is uniquely identified by its memory address
Therefore, a label is actually a symbolic name for some memory address
I.e.: a label is an identifier that is used to represent some memory address
We will learn about labels in the next webpage.
[ stuff ] - the stuff inside the square brackets [ ] are optional stuff ... - means: the stuff may be repeated |
You will see in the syntax examples in each directive hwo I use these notations
.global identifier [, identifer ... ] |
The .global directive makes an identifier accessible to the "loader" program ld that combine multiple program files into one executable program
You don't need to know the details how the ld (loader) program work, you only need to know the effect of the .global directive:
|
How to run the program:
|
Type x into the Variable Name area.
Select SI (signed integer)
Then click Add.
The value in the variable x will be be displayed in EGTAPI (you should see 4444)
.end |
Tells the assembler to stop.
All text that follows the .end directive will be ignored by the assembler