Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Assembly ~ directly controlling CPU ~

kumaGoro95
February 17, 2021

The Assembly ~ directly controlling CPU ~

I'm not the IT engineer, but I've been learning programming in Java to become the backend engineer. I made this slide as part of my studies.
This slide explains "What is the Assembly language?" very simply to those who hardly know the Assembly.

kumaGoro95

February 17, 2021
Tweet

More Decks by kumaGoro95

Other Decks in Programming

Transcript

  1. ~The Assembly~ directly controlling CPU kumaGoro

  2. OutLine 1. What is the Assembly Language? 2. Its features

    3. The benefit using the Assembly
  3. 1. What is the Assembly Language?

  4. In Simple Words... The most nearest language to “Machine Language”

    
   ・The LG to control CPU ・Written in Bytecode(10010...)
  5. 2. How this language works?

  6. The features 1. Control CPU by yourself 2. One Line,

    One Instruction 3. It differs from the type of CPUs  
  7. 1. Control CPU by yourself If we do “20 +

    30” in Java… int result = 20 + 30; I save it in the Address No.xx in the memory. → Computers automatically choose the Address for the result.
  8. How about the Assembly?

  9. “Registers” & “Main Memory” A data storage outside the CPU

    A small storage inside the CPU ↓ ↓
  10. I want to add 20 to 30... When people use

    the Assembly...
  11. I put 20 on “eax” & 30 on “ebx”! 20

    30 When people use the Assembly...
  12. CPU, please do calculation! 20 30 Answer is 50!

  13. I want to store the result... = 50 → Coder must

    control CPU by yourself! I put on the Address No.1!
  14. The features 1. Control CPU by yourself 2. One Line,

    One Instruction 3. It differs from the type of CPUs  
  15. 2. One Line, One Instruction Instruction? Loading data Adding numbers

    Copying data
  16. 2. One Line, One Instruction <Java> int x = 10

    + 20; Looks like 1 Instruction...
  17. 2. One Line, One Instruction <Java> int x = 10

    + 20; ↑ putting number on the memory adding numbers ↓ Several Instructions! Initializing the variable ↓
  18. How About Assembly…? mov eax , 10 ↑ Opecode (Instruction)

    ↑ Operand(target of Instruction) (Address,Data) <Basic rules>
  19. ”0011” ⇔ ”LD” called “Mnemonic” Simply replacing! Machine Code ⇔

    Assembly <Machine code> <Assembly> ex) Loading Data Instruction
  20. How About Assembly…? xor eax, eax xor ebx, ebx mov

    eax, 20 mov ebx, 30 add eax, ebx ← Initializing register “eax” ← Copying 20 to “eax” ← Copying 30 to “ebx” ← Adding eax(20) to ebx(30) One line, One Instruction! ← Initializing register “ebx” “20 + 30”
  21. The features 1. Control CPU by yourself 2. One Line,

    One Instruction 3. It differs from the type of CPUs  
  22. 3. It differs from the type of CPUs Intel AMD

    etc...
  23. But, Why? A, Opecodes & Types of Registers differs from

    the type of CPUs → There are more 50 types of Assembly!
  24. 3. The benefit Using Assembly

  25. The assembly is... ・ Coder have to think about Registers

    & Memory ・ In addition, they have to write instructions one by one   → Really inconvenient!    Why people use the Assembly?
  26. Why people use the Assembly? A. “High Speed Processing” 

  27. For What purpose is the Assembly used? • in the

    past… Used for Computers(CPUs of these days were low-spec ...) • Now... Used for IoT! (Many electrical appliances have microcomputers) → I thought the Assembly is old-fashioned,         but still necessary for innovation!
  28. Thank you for listening!