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. In Simple Words... The most nearest language to “Machine Language”

    
   ・The LG to control CPU ・Written in Bytecode(10010...)
  2. The features 1. Control CPU by yourself 2. One Line,

    One Instruction 3. It differs from the type of CPUs  
  3. 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.
  4. I put 20 on “eax” & 30 on “ebx”! 20

    30 When people use the Assembly...
  5. I want to store the result... = 50 → Coder must

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

    One Instruction 3. It differs from the type of CPUs  
  7. 2. One Line, One Instruction <Java> int x = 10

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

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

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

    Assembly <Machine code> <Assembly> ex) Loading Data Instruction
  11. 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”
  12. The features 1. Control CPU by yourself 2. One Line,

    One Instruction 3. It differs from the type of CPUs  
  13. But, Why? A, Opecodes & Types of Registers differs from

    the type of CPUs → There are more 50 types of Assembly!
  14. 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?
  15. 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!