codingOL

[ARCHORG] MP1 template??

Dec 7th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BITS 32
  2. GLOBAL _asm_main
  3. EXTERN _printf
  4.  
  5. SECTION .data
  6. row1 dd 5,7,3,1
  7. matrixB dd 4,9,3,1
  8. timestamp resb 16
  9.  
  10. SECTION .text
  11. _asm_main:
  12.     ENTER 0,0
  13.    
  14.    
  15.     ; initialize the code here
  16.  
  17.    
  18.     ; ReaD TimeStamp Counter
  19.    
  20.     RDTSC
  21.    
  22.     ; Save initial timestamp
  23.    
  24.     MOV [timestamp], EAX
  25.     MOV [timestamp+8], EDX
  26.    
  27.     ; push EAX and EDX to stack
  28.    
  29.     PUSH EAX
  30.     PUSH EDX
  31.    
  32.     ; Do the code now
  33.     ; [START]
  34.    
  35.    
  36.    
  37.    
  38.     ; [END]
  39.     ;
  40.    
  41.     ; pop EAX and EDX from stack
  42.    
  43.     POP EAX
  44.     POP EDX
  45.    
  46.     ; get difference of two timestamps
  47.     SUB EAX, [timestamp]
  48.     SUB EDX, [timestamp + 8]
  49.    
  50.    
  51.     LEAVE
  52.     RET
  53.    
  54.  
Advertisement
Add Comment
Please, Sign In to add comment