ADD Comand

JohnInTX

Joined Jun 26, 2012
4,787
Which processor and/or assembly language are you talking about? The format and behavior of the MOV or ADD command depends on which assembler is being used.
From the info found by @bertus, MC8 looks like a training processor board that's based on the Z80. Ch. 7 has the basic instruction set layout. From the manual (translated).
The CPU of the MC8 is formed by the 8-bit processor Zilog Z80 of the Training Board
At any rate, the TS needs to understand HEX and other number systems and the assembler syntax to express them before much else gets done. For example:
MOV B,C moves register C to register B
MOV B,0C loads register B with 12.
(if I remember MY Z80 syntax that is.. It may require a token to differentiate it from an address i.e. MOV B,#0c for immediate addressing.. My German is not so good..)
 
Last edited:

Thread Starter

thexy

Joined Dec 13, 2015
130
But the problem is that I haven't done any machinecode in my life so everything here is new to me. So I would like if someone could explain me how do I know if this what I got is fetch or execute?
Which register?
What value it has and so on?
 

hp1729

Joined Nov 23, 2015
2,304
Things to understand:
  1. You should get the same answer regardless of the number base that you use.
  2. You need to make yourself a hexadeximal addition table with 16 rows and 16 columns
  3. Verify that you get the same answer in decimal, hexadecimal, and binary.
  4. If steps 1-3 fail, then a switch to Art History is recommended.
Re: art history
:) He isn't an engineer, yet.
Don't you remember what it was like to not have a background of learning to work with. Show him where the rocks are.
 

hp1729

Joined Nov 23, 2015
2,304
But the problem is that I haven't done any machinecode in my life so everything here is new to me. So I would like if someone could explain me how do I know if this what I got is fetch or execute?
Which register?
What value it has and so on?
The Fetch cycle reads the instruction from program memory and puts it in the Instruction Register.
During Execute the instruction register is interpreted to give an operation to be performed, where data is to come from and where the result is to be stored.

Programmable registers. Registers that can be altered by a program. In the Z80 all are 8-bits wide.
A - Accumulator. Contains the result of the last operation.
B, C, D, E, H, L are General purpose registers.
H and L has a special use as a memory location an instruction may reference. H (higher 8 bits) and L (lower 8 bits) can be used to form a 16-bit address.
 

Thread Starter

thexy

Joined Dec 13, 2015
130
The Fetch cycle reads the instruction from program memory and puts it in the Instruction Register.
During Execute the instruction register is interpreted to give an operation to be performed, where data is to come from and where the result is to be stored.

Programmable registers. Registers that can be altered by a program. In the Z80 all are 8-bits wide.
A - Accumulator. Contains the result of the last operation.
B, C, D, E, H, L are General purpose registers.
H and L has a special use as a memory location an instruction may reference. H (higher 8 bits) and L (lower 8 bits) can be used to form a 16-bit address.
Okay I understand, in my case it's fetch or? But which register I need to put in my tabelle?
 

Papabravo

Joined Feb 24, 2006
21,227
Re: art history
:) He isn't an engineer, yet.
Don't you remember what it was like to not have a background of learning to work with. Show him where the rocks are.
It is my stock recommendation for those who display little or no aptitude for turning over rocks and making discoveries on their own. If you just don't get certain things there is really no reason for continued self flagellation. I'm just trying to say that it is OK to not get this stuff.
 

hp1729

Joined Nov 23, 2015
2,304
Okay I understand, in my case it's fetch or? But which register I need to put in my tabelle?
I am not sure what your teacher has in mind there.
On hex math ... do you have windows? You probably have a Programmer's Calculator on your computer already. it does math in binary, octal, hexadecimal or decimal and converts.
 
Last edited:

hp1729

Joined Nov 23, 2015
2,304
How can I know which adress is A and B? Why did you choose 0004?
"How can I know which address is A and B?"
A and B are registers and don't have a memory address.

Memory address ... The Z80 is a von Neumann design. Data and program share the available memory space. For the Z80 that is a basic 64K bytes of memory, 0000 to FFFF. But that can be expanded. "A" and "B" don't have an address until they are stored in memory, then they are referred to by that memory address.
A and B are registers inside the processor.
Starting at page 22 of http://forum.allaboutcircuits.com/attachments/01_zusammenfassung_digitalesysteme-pdf.98221/
Page 27 starts on instructions.
Personally, I find the book lacking in pictures and details to describe the processor and instruction set.
 
Last edited:

hp1729

Joined Nov 23, 2015
2,304
It is my stock recommendation for those who display little or no aptitude for turning over rocks and making discoveries on their own. If you just don't get certain things there is really no reason for continued self flagellation. I'm just trying to say that it is OK to not get this stuff.
Have you forgotten what it was like not to have a foundation of knowledge to work from?
 

Papabravo

Joined Feb 24, 2006
21,227
Have you forgotten what it was like not to have a foundation of knowledge to work from?
It was so long ago my recollections are fuzzy. I was very young when I got in the habit of continuously asking questions about things I did not know. I don't feel like I was ever in that position. Maybe I was just lucky.
 
Last edited:

Thread Starter

thexy

Joined Dec 13, 2015
130
Hello.

how do I know what is for example source, goals, value of Data bus? (I'm talking about tabele from #1)
 

Thread Starter

thexy

Joined Dec 13, 2015
130
Hello. how do I know what is for example source, goals, value of Data bus? (I'm talking about tabele from #1)
 

JohnInTX

Joined Jun 26, 2012
4,787
Hello. how do I know what is for example source, goals, value of Data bus? (I'm talking about tabele from #1)
You keep asking the same question. Several posts here describe what you need to know. Read them until it makes sense.
The MC8 uses a Z80 processor. I have attached the manual which shows the address-fetch-execute bus data (starting on page 8). The ADD instructions are described beginning on page 143. Everything you need to know is there and in the previous posts. Short of filling out the table for you, that's all I, or anyone else here, can offer.

Fill out your table and post it. Someone will probably be willing to check it for you or maybe just wait until you cover it in class.

Good luck.
 

Attachments

Top