Computer Architecture/Inside the Machine

The Mechanics of Program Execution (Chapter 2)

Tony Lim 2020. 12. 26. 15:32
728x90

The English words in a program, like add, load, and store, are mnemonics(meaning they’re easy for people to remember), and they’re all mapped to strings of binary numbers, called opcode

Opcode Mnemonic
same for register

mode bit == if the mode bit is set to 0 then the instrction is register -type instruction else immediate type

the last six bits(10~15) are paeeded with 0s because they are not needed

3 kinds of machine language format (Load instruction)

load #12 A == # to indicate it is source address in memory
since we only have 4 register we only need 2 bits for source and destination
Load!  Source(base + offset) to destination register 

 

The Programming Model and the ISA

now we have "control unit" and 8 register and "I/O unit"

instruction fetch == it always takes the address that's currently in the program counter reigster(PC) as its source and the instruction register as destination.

after fetched in to instruction register it is decoded before executed. while decoding , processor places the address of the next instruction into the PC. In case of 2 byte instrctions(DLW-1) increase range is 2

instruction execute == if arithmetic instrction, use ALU and register file , if memory access instruction use memory-access hardware, if branch then execute it using the control unit and the program counter.

Unconditional Branch == branch instrcution + target address // jump #target

Conditional Branch == jump by condition. In DLW-1 case processor status word register (PSW) handles the case study. 

1. check for appropriate bit in PSW

2. if the branch condition evaluates to true, then the control unit replaces the address in the PC with the branch target address

3 . if false then PC is left as it is. and the next instruction in the normal program sequence is fetched

What is reboot or boot

1. the first line of instruction when computer is on , is to execute BIOS which is in small ROM module attached in motherboard

2. BIOS perfom basic test and jump to location of  bootlaoder porgram , whose job is to search for and load the computer's OS

3 once the OS is up it is ready to interact with user

728x90