[CrashCourse CS] #8 Instructions & Programs

Steve·2021년 4월 12일
0

CPU is programmable.
CPU is a hardware which is controlled by easy-to-modify software.

Couple more instructions for CPU:

InstructionDescription
SUB (Subtract)Subtract two registers, store value into second registers.
JUMPUpdate instruction address register to new address.
JUMP_NEG (Jump Negative)If ALU result was negative, update instruction address register to new address.
HALTProgram done. Halt computer.
  • Other instructions : JUMP_IF_EQUAL, JUMP_IF_GREATER, ...

  • Software allows jobs that hardware can't do - ex) division.
  • Modern processors have thousand instructions.

Thoughts

  • If 조건문이 CPU 레벨의 JUMP 에서부터 시작되었구나...
profile
게임과 프론트엔드에 관심이 많습니다.

0개의 댓글