mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
vault backup: 2022-07-26 12:48:12
This commit is contained in:
parent
b10a1ff35b
commit
5d6bcb8745
@ -13,9 +13,55 @@ tags:
|
||||
|
||||
# Working up
|
||||
- High level languages
|
||||
- Compiler
|
||||
- ↓ Compiler ↓
|
||||
- Assembly language
|
||||
- Assembler
|
||||
- ↓ Assembler ↓
|
||||
- Machine code
|
||||
- Instruction Set
|
||||
- Hardware
|
||||
- ↓ Instruction Set ↓
|
||||
- Hardware
|
||||
|
||||
# Motorola MC6809 CPU
|
||||
- 6809 (1978) 9000 transistors
|
||||
- Apple M1 Ultra (2022) 114,000,000,000 transistors
|
||||
|
||||

|
||||
|
||||
# Machine Code
|
||||
- Computers are controlled by bit-patterns.
|
||||
- These patterns determine what the CPU does and to which memory location
|
||||
- Assign values to registers
|
||||
- load registers from memory
|
||||
- add numbers to registers
|
||||
- store registers in memory
|
||||
- and so on
|
||||
- This is called machine code
|
||||
|
||||
It is not very easy to programm this way
|
||||
- slow
|
||||
- not human readable
|
||||
- difficult to debug
|
||||
- etc
|
||||
|
||||
To make the process easier, we assign names to the numbers. This allows us to program symbolically. We call this assembly language programming
|
||||
|
||||
## Programmer's Model
|
||||
|
||||
The programmer's model of a computer is not the same as the hardware model. The hardware makes the computer look a par
|
||||
|
||||
## 6502 Fibonacci in Machine Code
|
||||
|
||||
Example program:
|
||||
|
||||
- 4C 13 00 00 00 00 00 00
|
||||
- 00 00 00 00 00 00 00 00
|
||||
- 00 00 00 A2 10 A9 01 8D
|
||||
- 10 00 8D 11 00 8D 12 00
|
||||
- A9 31 8D 0F 00 8D 0F 00
|
||||
- AD 10 00 6D 11 00 8D 12
|
||||
- 00 69 30 8D 0F 00 AD 11
|
||||
- 00 8D 10 00 AD 12 00 8D
|
||||
- 11 00 CA D0 E3
|
||||
|
||||
[visualisation of comuter](http://www.visual6502.org/JSSim/expert.html?loglevel=0&a=0000&d=4C130000000000000000000000000000000000A210A9018D10008D11008D1200A9318D0F008D0F00AD10006D11008D120069308D0F00AD11008D1000AD12008D1100CAD0E3)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user