Shared Flashcard Set

Details

Low Level Programing
CIS2107 temple
63
Computer Science
Undergraduate 2
05/03/2010

Additional Computer Science Flashcards

 


 

Cards

Term
compile to ./a.out
Definition
gcc filename.c
Term
compile to new executable name
Definition
gcc -o
Term
steps of compiling
Definition
source.c(text)->PREPROCESSOR->
source.i(moifided text)->COMPILER->
source.s(assembly text)->ASEMBLER->
source.o(binary)->LINKER->
Execuatble binary
Term
preprocessing:
Definition
gcc –E –o welcome.i welcome.c
Term
compiling:
Definition
gcc –S –o welcome.s welcome.i
Term
assembling:
Definition
gcc –c –o welcome.o welcome.s
Term
linking:
Definition
gcc –o welcome welcome.o
Term
how to examine binary files
Definition
– objdump –d
(-d to disassemble)
Term
decimal units list >0
Definition
kilo 10^3
mega 10^6
giga 10^9
tera 10^12
peta 10^15
Term
units <0
Definition
Mili 10^-3
micro 10^-6
nano 10^-9
pico 10^-12
Term
hex letter representation
Definition
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
Term
intel byte sizes
Definition
byte 1 byte
word 2 bytes
doubleword 4 bytes
quadword 8 bytes
double quadword 16 bytes
Term
NOT represenation
Definition
~ opposite 1->0 , 0->1
Term
bitwise AND Representation
Definition
& 0&0=0 0&1=0 1&0=0 1&1=1
Term
OR Rep
Definition
|
0|0=0
0|1=1
1|0=1
1|1=1
Term
bitwise XOR rep
Definition

^

0^0=0

0^1=1

1^0=1

1^1=0

Term
a XOR b XOR b = ?
Definition
a
Term
Define the endians
Definition
Big endian - most significant byte first
Little endian - least significant byte first
Term
how to find 2's comp
Definition
get ones comp (flip bits)
add one
Term
convert fractions
Definition

multiply decimal by 2 record whole number

repeat until decimal =0;

Term
machine representation of floats
Definition
|sign(1)|Expontent(8)| mantissa(23)
Term
steps for converting to float
Definition
set sign bit move decimal to behind first 1 exponent+127 convert to binary ,add after sign bit add number + 0's to fill up to 23 spots
Term
switch to see assembly output
Definition
gcc -S
Term
AX register
Definition
overall 16 bits composed of AH and AL
Term
EAX register
Definition
32 bits
16bits + AX registers
Term
RAX register
Definition
64 bit- 32bits plus EAX
Term
Common use of EAX
Definition
accumulator,return
Term
Common use of EBX
Definition
pointers to items in data segment
Term
Common use of ECX
Definition
loop control
Term
Common use of EDX
Definition
I/O pointers
Term
Common use for ESI
Definition
src ptr for string ops
Term
Common use for EDI
Definition
destination pointer for string opps
Term
Common use for ESP
Definition
Stack Pointer
Term
Common use for EBP
Definition
Base pointer
Term
GDB disas
Definition
disembles current function
Term
size of char
Definition
1byte
Term
size of int
Definition
4bytes
Term
size of float
Definition
4bytes
Term
size of double
Definition
8bytes
Term
unix shell command: ls
Definition
list files in a directory
Term
unix shell command: cd
Definition
change directory
Term
unix shell command:cmp
Definition
compare files
Term
unix shell command: diff
Definition
compares two files and shows the lines that are different
Term
unix shell command: mkdir
Definition
make a directory
Term
Unix shell command: mv
Definition
Renames a file or moves it from one directory to another directory.
Term
Unix shell command: pwd
Definition
print current working directory
Term
Unix shell command: rm
Definition
remove a file
Term
Unix shell command: rmdir
Definition
delete a directory
Term
Unix shell command: more
Definition
shows the next page of a file
Term
Unix shell command: ls-l
Definition
see permissions of a file
Term
Unix shell command: cd..
Definition
move up a directory
Term
Unix shell command: ">"
Definition
saves programs output to a file
Term
Unix shell command: "<"
Definition
uses input from a file
Term
gcc -c prog.c
Definition
compile without running the linker
Term
Steps for calling a fuction in assembly
Definition

From the caller:

 

save the callers state

pass the paramaters of the function

save return address

give control to the function

 

In the function:

allocate space for locals

execute function instructions

return result

give control back to the caller.

Term
In the stack where are the local varaibles and where are the parameters
Definition
local variables are above (negative)the old base pointer and parameters are below the old base pointer (positive)
Term
what happens at the begining and end of every function call
Definition

begining

pushl %ebp

movl %ebp,%esp

 

end

movl %ebp,%esp

popl %ebp

 

Term
four basic read-write memory regions in a program
Definition

Stack

 

Data- contains global and static variables used by the program that are initialized

 

BSS-uninitialized global variables and static variables that are initialized to zero

 

Heap- area is managed by malloc, realloc, and free

stack-contains frame pointers*

Term
fuction to check if machine is big/little edian
Definition

int x=0xFF;

char s*=&x;

return *s==0;

Term
TC Max
Definition
0x7fff
Term
TC min
Definition
0x8000
Term
what does a system call do
Definition
stops current program to call the kernal to run and then control is returned to the program
Term
what does a system call do
Definition
stops current program to call the kernal to run and then control is returned to the program
Supporting users have an ad free experience!