The sketch
Please check @tomerg's presentation
1975
(Insert binaries here)
A
We can read and write data
A == #1h
A
B
What is the initial value of A and B?
We don't know! That is why we need to add zero to them, or loading a value before adding their content.
When I perform the ADDA instruction, where does the result go?
To A. The results of almost all of the operations usually go to A.
So... Is A mutable?
Yes.
So do I loose the initial value of A after ADDA?
Yes.
Ouch.
Yes.
How does the program know which is the next instruction?
There is (for almost all of the CPUs) a special register that points to the next instruction. We call it Program Counter (PC). At the beginning of the program, it points to zero or any other value established by the manufacturer. The first instruction starts there.
So, are the instructions in memory?
For the 6800, yes.
Am I free to manipulate the content of all of the registers?
Not all of them. There are some that only accept memory addresses as parameters. Other do not support any kind of operation, except for transferring memory addresses.
So Am I allowed to load A with a memory Address?
Yes.
WTH is #?
# is about what we call Address mode. # makes explicit that we are loading the number 0h (0 hex) in A.
What does it happen if I remove #? Fail?
Not in terms of syntax. Removing #, the CPU will load the content of the position 0h of the memory.
Still about #
So removing # gives us a different address mode, right?
Yep! We call it direct addressing. With #, we have the immediate addressing.
Can I manipulate hex numbers only?
No. You can manipulate binaries, decimals. But hex is more common.
Are the numbers signed or unsigned?
We have both representations. Usually, for signed numbers, the left bit represents the signal. For example:
10000001 can be 129 or -1
Who does determine if it is signed or unsigned?
The program's context. And it is tricky. Do not mix them up!
What happens if the result is larger than 8 bits?
(each CPU has its own)
1978
Data bus - 16 bits
More registers
More instructions
Registers
A
B
C
D
(Accumulator)
(Base)
(Counter)
(Data)
Segmented memory model
CS
DS
SS
ES
(Code)
(Data)
(Stack)
(Extra)
Your code
(Code)
(Data)
(Stack)
1984
Simplified set of instructions, similar to several processors in the market.
http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
(2k pages)
Questions?
hannelita@gmail.com
@hannelita