Skip to content

Latest commit

 

History

History

Basic_ASM

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Basic ASM

拿到一個assembly code

  • AT&T的格式: src, dst
  • 手動把assembly code轉成C code:
#include <stdio.h>

int main() {
  int ebx = 17984;
  int eax = 7205;
  int ecx = 1429;

  if(ebx < eax) {
    ebx *= eax;
    ebx += eax;
    eax -= ecx;
  } else {
    ebx *= eax;
    ebx -= eax;
    eax = ebx;
    eax += ecx;
  }

  printf("%d", eax);

  return 0;
}