I need 8085 cources ...

Thread Starter

Hannibal666

Joined Jan 25, 2016
12
Hi,
is anyone have microprocessor 8085 cources?

I`m tired from looking for it on the internet..

I need an introduction for it and I need cources about :
instruction classified into :-
*Data Transfer instructions group
*Arithmatic instuctions group
*Logical instruction group
*Branch instruction group
*I/O and Machine Contorl group

with examples please..
______
and I need an explantion about this paper please :-

sorry, but I`m in bad collage :(
 

Attachments

JohnInTX

Joined Jun 26, 2012
3,824
I worked with the 8085 for years. Everything you need to know about the processor and its assembly language is in the attached references.

The Family User's Manual describes the CPU hardware and has a brief introduction to the instruction set.

The Assembly Language Programming manual describes the instruction set in detail with examples and also describes how to construct an assembly language program using a typical assembler. Programming concepts, assembler control directives, programming techniques such as using macros, interrupts etc. are also covered.

The SDK-85 User's Manual actually describes an old experimenter's kit. It's no longer available but at the end of the document the complete assembler source code for the kit's firmware monitor is shown. Many useful subroutines are there and you can see how a real program is constructed. If you take a subroutine and examine the instructions step by step, you'll get a good idea of how each instruction works.

If you have questions about something specific, let us know.

Good luck.
 

Attachments

Last edited:

Thread Starter

Hannibal666

Joined Jan 25, 2016
12
thank you MR.bertus and thank you johnlnTX
for helping and for pdfs,

may I know what is mean (HL)? in 8085
and what is that ? :-
MVI b,3c
MVI A,c2
ADD B
STA 3322
HLT -> run
_____

please I want to understand cause I have an exame
 

Papabravo

Joined Feb 24, 2006
12,514
HL is a pair of 8-bit registers inside the processor. It is generally used as an address pointer for an indirect reference to memory, or as a 16-bit accumulator for sme arithmetic instructions.
 

Thread Starter

Hannibal666

Joined Jan 25, 2016
12
Code:
STA 3322  ;STORE A REG IN 3322H
thank you very very much...

but I have a last question please,

why {STORE A REG IN 3322H}?
why not B reg...?
 

absf

Joined Dec 29, 2010
1,942
Code:
STA 3322  ;STORE A REG IN 3322H
thank you very very much...

but I have a last question please,

why {STORE A REG IN 3322H}?
why not B reg...?
The 8085 doesn't have the instruction STB 3322

But
if you want to store content of "B Reg" into address 3322H, you can do it in 2 instructions as follows:

Code:
MOV   A,B      ;make A=B
STA    3322H   ;store A into 3322H
Allen

p/s here is a 8085 cheat sheet which may be useful for learning 8085 ASM language...
 

Attachments

JohnInTX

Joined Jun 26, 2012
3,824
Allen's chart is an excellent reference. While learning, try to see the similarities in the various instructions and note the differences where they occur.

Here are a few things about the instruction set that may help you learn it.
MOV instructions always copy the second register specified to the first one - for MOV B,A say 'MOVE to B from A'. Other processors are the other way around.

Some registers are more important than others:
A (accumulator) is one argument and the result of all 8 bit arithmetic and logic operations. It is implied in the instructions so it is not always specified i.e. ADD B implies A = A+B.

HL (register pair HL). Two individual registers that, depending on the instruction, can be used as a 16 bit address to perform operations on data in memory i.e. ADD, MVI etc. HL can be modified using the double add (DAD) instruction. HL can be swapped with the top of the stack. Note that pairs DE and BC can also be used as 16 bit pointers but are not as powerful - data accessed by them always uses A, no double add etc.

M is not a physical register but refers to the byte in memory pointed to by HL. ADD M adds the memory byte pointed to by HL to A and puts the result in A. This is called 'indirect addressing'.

PSW (processor status word) contains the various flags that are set by arithmetic, logical operations. It is paired with A. Frequently, PSW and A are PUSHed to the stack (PUSH PSW) to save A and the flags while doing something else then POPed to restore them.

When designing your programs, reserve A and HL for their 'special' capabilities and use the other registers (and RAM) for basic storage.

Good luck.
 

Thread Starter

Hannibal666

Joined Jan 25, 2016
12
The 8085 doesn't have the instruction STB 3322

But
if you want to store content of "B Reg" into address 3322H, you can do it in 2 instructions as follows:

Code:
MOV   A,B      ;make A=B
STA    3322H   ;store A into 3322H
Allen

p/s here is a 8085 cheat sheet which may be useful for learning 8085 ASM language...
very special thanks to you.. I have now 70% of fully understand of MVI and MOV and STA instructions..

may I ask you another question please..
y=x+5 if x>10
y=x+2 if x <=10
Σ N 50h
MOV B,A
SUI 0Ah
J S : xx
MOV A,B
ADI 02h
JMP : yy
xx : MOV A,B
ADI 05h
yy : HLT


may you tell me what is that thing in details please? .in last exam all students couldn`t answer that question about finding x value

and we use 8085 v3.4 in our bad collage..
 

Thread Starter

Hannibal666

Joined Jan 25, 2016
12
Here are a few things about the instruction set that may help you learn it.
MOV instructions always copy the second register specified to the first one - for MOV B,A say 'MOVE to B from A'. Other processors are the other way around.

Some registers are more important than others:
A (accumulator) is one argument and the result of all 8 bit arithmetic and logic operations. It is implied in the instructions so it is not always specified i.e. ADD B implies A = A+B.

HL (register pair HL). Two individual registers that, depending on the instruction, can be used as a 16 bit address

ADD M adds the memory byte pointed to by HL to A and puts the result in A. This is called 'indirect addressing'.



Good luck.
thank you,
but what is 8 bit arithmetic and logic operations ?

and about "ADD B implies A = A+B."

you mean instruction ADD is used just for A reg right?
after that reg B will be erased and reg A with its data will remain right?

and STA 2000H

I know it is mean store reg A in memory location 2000
but what is "H" letter?
is mean the first letter of HL symbol and we right 2000H not 2000HL for shortcut?

 

JohnInTX

Joined Jun 26, 2012
3,824
STA 2000H in this context, H means hex i.e. the value is expressed in hexadecimal 2000H = 8192 decimal. The assembler has its default radix (hex, decimal, octal etc) but its important to always express your numbers with the radix to avoid confusion.
you mean instruction ADD is used just for A reg? After that reg B will be erased and reg A with its data will remain right?
No, the other way around. A (the accumulator) gets the new calculated sum - the result - of what originally was in A added to what is in B. B (and any other register that may be added, subtracted or other operation) is unchanged.
but what is 8 bit arithmetic and logic operations ?
Adding, subtracting, ORing, ANDing and the like. The 8085 has a basic data size of 8 bits so the operations it provides use 8 bit registers (mostly). If you want bigger data like 16bits, you have to do the operations on each byte separately. Note that code flow is frequently determined by data values that are tested using arithmetic. In the example below, the variable 'x' is examined to see if it is greater than 10. There is no instruction that does that in the 8085 but there ARE instructions that will jump on the result of some arithmetic operation by examining the flags in the processor status word (PSW). In the example, x is compared to 10 by subtracting 10 from the unknown value x. If x was >10, the S bit will be set. The code does the subtraction then tests the result of the subtraction by jumping if the S bit is set. The net result is jump if x>10.
Code:
;These are comments that describe what the following routine(s) do.  You can tell by the fact ;that it looks different than the 8085 assembly language and instruction set.  The instructions ;following the comments do the arithmetic described.
; y=x+5 if x>10
; y=x+2 if x <=10
; Σ N 50h;

; Test: y=x+5 if x>10
; A register has 'x'.  Copy it to register B to save it
  MOV B,A
;  Compare 'x' (in A) to 10 decimal (0Ahex) by subtracting  x (in A) - 10 (the immediate
; value in the instruction itself). If x >10, S will be 1 and the code will jump to the line labeled ;xx.
;If x<=10, no jump will occur and the code will flow to the next instruction.
;Note that the numerical result of the subtraction is placed back in A.  That's why
;we saved a copy of x in B for further use - the result replaces the original value.
  SUI 0Ah
  J S: xx  ; x>10  ; Usually, assemblers do NOT allow or require a ':' when referencing a label

; x <= 10 so add x+2
  MOV A,B ; get the saved copy of x to the accumulator A again.
  ADI 02h ; add 2
  JMP : yy ; unconditional jump to the line labeled yy

; It jumps here when x>10
xx : ; xx is a label so that the code above knows where to jump to
  MOV A,B ; get the copy of x again
  ADI 05h ; add 5 to it (note 05h == 5 in decimal too)
;* Code flows to the HLT

yy : ; labels should be on their own line and start in column 1
HLT ; stop
 
Last edited:

absf

Joined Dec 29, 2010
1,942
very special thanks to you.. I have now 70% of fully understand of MVI and MOV and STA instructions..

may I ask you another question please..
y=x+5 if x>10
y=x+2 if x <=10
Σ N 50h
MOV B,A
SUI 0Ah
J S : xx
MOV A,B
ADI 02h
JMP : yy
xx : MOV A,B
ADI 05h
yy : HLT


may you tell me what is that thing in details please? .in last exam all students couldn`t answer that question about finding x value

and we use 8085 v3.4 in our bad collage..
Oops I can't do this one as well. Don't understand what is the 3rd and 6th instructions are doing...:p

May be John can help.:)

Allen
 

JohnInTX

Joined Jun 26, 2012
3,824
I don't understand the 3rd one either and wrote it off as a stray comment..
The 6th is a macro, I think. There is no actual JS instruction so I would guess that 'J' is the macro name and 'S' is a parameter that identifies the condition to test. As I noted, the colon is in a weird place, too. Based on the other code, I'd guess it evaluates to JP (jump on positive result) or JC? If the TS would post the assembler list file we could look at the generated machine code and see for sure.
I don't like it when macros and the like are used on a beginner.
 
Last edited:

Thread Starter

Hannibal666

Joined Jan 25, 2016
12
thaaaaaaank you very much....

I have a another question please....

how can I get the status of flag from instructions?
in our exam they give us a program and they want from us to get the status of flags ?
from that example
MVI B,49
DCR B
MOV C,B
HLT -> run


from that example how we get the status of flags without looking on the program just on the paper,



 

JohnInTX

Joined Jun 26, 2012
3,824
Look at the detailed instruction descriptions in the 8085 Assembly Language Programming Manual 1977 linked above.
MVI is described on page 3-37
DCR on page 3-21
MOV on page 3-36

What each instruction does is described. Part of the description is what flags are affected.
MVI and MOV do not affect ANY flags. They just load a register and move data.
DCR is an arithmetic operation that does affect the flags. DCR decrements a register i.e. subtracts 1 from it. According to the description the Z,S,P, and AC flags are set or cleared according to the result after decrementing. If the register had a value of 1 to start with then after DCR, Z=1 (result is 0), S=0 (zero result is positive), P=1 (zero result has even parity) and AC=0 (no carry from bit 3 to 4).

In the case of DCR, you wouldn't likely care about P or AC but Z and S are useful. There is an example using DCR on page 3-21.
The image below is from the MCS-85 Family Reference (but surely in the Assembly Language manual too - just don't know where..) and it describes the flags in detail. The flags are contained in the Processor Status Word (PSW).
upload_2016-4-29_22-31-48.png

For your code snippet:
MVI B,49 ; loads 49 (decimal) into register B. We don't know what the flags are because we don't know what they started as and MVI does not change any flags.
DCR B ; Aha! DCR does change flags. The result in B is 49-1 = 48 and the flags will reflect that. The Z flag is 0 (result is Not Zero). S is set to 1 (result is a positive number i.e. MSBit of the result in B is 0). P=1 (48 decimal is 110000 - an even number of 1's). AC is cleared since there was no carry from bit 3 to 4 (P and AC are not really useful here).
MOV C,B ; MOV does not affect the flags so they are what they were before. You would express them as NZ, S. If the next instruction was JNZ, it would jump. If it was JZ, it would not jump. Note that testing Z tests for a zero result. Testing S (the sign) tests for underflow. Which one you would use depends on what you are doing, Z is the most common for loop counters, etc.
HLT -> run

Going a bit further, since MOV and MVI don't change the flags how would you test a value for Z or NZ without changing it? The answer is to do some arithmetic on the value that doesn't change it:
MOV A,M ; move a byte from memory to A - flag values are unknown.
ADI 0 ; add 0 to A, the value is unchanged but the flags are updated. ORI 0 does the same thing and is actually better - can you think of why?
JZ value_was_zero ; jumps if the byte in memory is 0

That's how it is done!
Have fun.
 
Last edited:
Top