Assembly Part 2 Flashcards
.file
Allows a name to be assigned to assembly language source code file
.section
This makes the specified section the current section (required)
.rodata
Specifies that the following data to be placed in the read only memory portion of the executable (required if you have read only data)
.data
Changes or sets the current section to the data section
.text
Changes or sets the current section to the text (or code) section
.globl
A directive needed by linker for symbol resolution: followed by name of function
.type
Needed by the linker to identify the label associated with a function, as opposed to data
.size
Needed by the linker to identify the size of the text for the program
.align
Needed if we want to declare values on the head to start an address that has a particular byte alignment (1,2,4,8)
What happens if you want to declare static class variables
In the .data or .rodata section of program, you need to declare the values
.quad value
.long value
.word value
.byte value
.string
.quad
Places given value in memory encoded by 8 bytes
Other data sizes
.long, .,words, .byte, .string
Leaq
Address computation
Sale
Shift arithmetic left
Imulq
Signed multiply
The program stack is divided conceptually into ____
Frames
Each procedure or function has its own part of the stack to use which is called the ____
Stack frame
The stack frame goes from the stack address pointed to by ___. This is called the ___/____ pointer to %______ which points to the ____ of the stack
%rbp, frame,base, top
_____ must be set when the procedure is entered
%rbp
First use of stack
Save the _____ %rbp before setting our frame pointer
Caller
Second use of stack
Before calling another function, perverse values needed using ____/_____
Push, pop
Third use of stack
To pass _____ to another function (only if there are more than 6 parameters to pass)
Parameters
Fourth use of stack
To store the _______ ________ when a call instruction is executed
Return address