Questions about this topic? Sign up to ask in the talk tab.

Difference between revisions of "Assembly"

From NetSec
Jump to: navigation, search
Line 1: Line 1:
 +
 +
== Introduction ==
 
* assembler
 
* assembler
 
* linker
 
* linker
 +
 +
* Assemble-time: Assembly & operands -> Opcode Sequence
 +
* Link-time: Flat binary of opcode sequence -> executable file format for OS
 +
* Runtime: Opcode Sequence -> hardware gates (may interact with ram etc)
  
  
'''Data size & hex:'''
+
== Binary ==
  
 
* counting
 
* counting
 +
* endianness
 
* nybble  
 
* nybble  
 
* byte  
 
* byte  
Line 13: Line 20:
  
  
'''Number handling:'''
+
== Number handling ==
  
 
* signed
 
* signed
Line 20: Line 27:
  
  
'''Data storage:'''
+
== Data storage ==
  
 
* register
 
* register
Line 29: Line 36:
  
  
'''Memory Addressing:'''
+
== Memory Addressing ==
  
 
* stack pointer  
 
* stack pointer  
Line 38: Line 45:
  
  
'''Instructions:'''
+
== Instructions ==
  
''Concepts:''
+
=== Syntaxes ===
 
+
* Assembly & operands -> Opcode Sequence
+
* Opcode Sequence -> hardware gates (may interact with ram etc)
+
 
+
 
+
''Syntaxes:''
+
  
 
* Intel (dest, src)  
 
* Intel (dest, src)  
Line 52: Line 53:
  
  
''Data manipulation basic primitives:''
+
=== Data manipulation basic primitives ===
  
 
* mov
 
* mov
Line 59: Line 60:
  
  
''Basic arithmetic:''
+
=== Basic arithmetic ===
  
 
* add
 
* add
Line 67: Line 68:
  
  
''Bitwise mathematics:''
+
=== Bitwise mathematics operators ===
 
+
 
* and
 
* and
 
* not
 
* not
Line 74: Line 74:
 
* xor
 
* xor
  
 
+
=== Shifts and rotations ===
 
* shl
 
* shl
 
* shr
 
* shr
Line 80: Line 80:
 
* ror
 
* ror
  
 
+
=== Control flow operators ===
''Control flow operators:''
+
 
+
 
* cmp
 
* cmp
 
* jmp
 
* jmp
Line 88: Line 86:
 
* ret
 
* ret
  
 
+
=== Taking it further ===
 
* kernel interrupt
 
* kernel interrupt
 
* architecture
 
* architecture
 
* operating system
 
* operating system

Revision as of 18:26, 10 May 2012

Introduction

  • assembler
  • linker
  • Assemble-time: Assembly & operands -> Opcode Sequence
  • Link-time: Flat binary of opcode sequence -> executable file format for OS
  • Runtime: Opcode Sequence -> hardware gates (may interact with ram etc)


Binary

  • counting
  • endianness
  • nybble
  • byte
  • word
  • dword
  • qword


Number handling

  • signed
  • unsigned
  • 2's compliment


Data storage

  • register
  • pointer
  • sub-register
  • cpu flag registers
  • architecture-specific registers


Memory Addressing

  • stack pointer
  • instruction pointer
  • base pointer
  • addressing mode
  • index


Instructions

Syntaxes

  • Intel (dest, src)
  • ATT (src, dest)


Data manipulation basic primitives

  • mov
  • push
  • pop


Basic arithmetic

  • add
  • sub
  • div
  • mul


Bitwise mathematics operators

  • and
  • not
  • or
  • xor

Shifts and rotations

  • shl
  • shr
  • rol
  • ror

Control flow operators

  • cmp
  • jmp
  • call
  • ret

Taking it further

  • kernel interrupt
  • architecture
  • operating system