Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Intel 8085
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Commands/instructions=== As in many other 8-bit processors, all instructions are encoded in a single byte (including register-numbers, but excluding immediate data), for simplicity. Some of them are followed by one or two bytes of data, which can be an immediate operand, a memory address, or a port number. A NOP "no operation" instruction exists, but does not modify any of the registers or flags. Like larger processors, it has CALL and RET instructions for multi-level procedure calls and returns (which can be conditionally executed, like jumps) and instructions to save and restore any 16-bit register-pair on the machine stack. There are also eight one-byte call instructions (RST) for subroutines located at the fixed addresses 00h, 08h, 10h,...,38h. These are intended to be supplied by external hardware in order to invoke a corresponding interrupt-service routine, but are also often employed as fast system calls. One sophisticated instruction is XTHL, which is used for exchanging the register pair HL with the value stored at the address indicated by the stack pointer. ====8-bit instructions==== All two-operand 8-bit arithmetic and logical (ALU) operations work on the 8-bit [[Accumulator (computing)|accumulator]] (the A register). For two-operand 8-bit operations, the other operand can be either an immediate value, another 8-bit register, or a memory cell addressed by the 16-bit register pair HL. The only 8-bit ALU operations that can have a destination other than the accumulator are the unary incrementation or decrementation instructions, which can operate on any 8-bit register or on memory addressed by HL, as for two-operand 8-bit operations. Direct copying is supported between any two 8-bit registers and between any 8-bit register and an HL-addressed memory cell, using the MOV instruction. An immediate value can also be moved into any of the foregoing destinations, using the MVI instruction. Due to the regular encoding of the MOV instruction (using nearly a quarter of the entire opcode space) there are redundant codes to copy a register into itself (''MOV B,B'', for instance), which are of little use, except for delays.<ref group="nb">Even so, there is no need for seven different effectively identical delay instructions, and they are also identical in effect and form to the NOP instruction, except that NOP conveniently has the opcode 00 hex.</ref> However, what would have been a copy from the HL-addressed cell into itself (i.e., ''MOV M,M'') instead encodes the [[HLT (x86 instruction)|HLT]] instruction, halting execution until an external reset or unmasked interrupt occurs.<ref group="nb">(The TRAP interrupt, being an [[Non-maskable interrupt|NMI]], can always bring the 8085 out of the HALT state.)</ref> <!-- It would be better if HLT were only mentioned here as regards opcode assignment and was explained operationally in a separate section about machine-control instructions--> ====16-bit operations==== Although the 8085 is an 8-bit processor, it has some 16-bit operations. Any of the three 16-bit register pairs (BC, DE, HL) or SP can be loaded with an immediate 16-bit value (using LXI), incremented or decremented (using INX and DCX), or added to HL (using DAD). LHLD loads HL from directly addressed memory and SHLD stores HL likewise. The XCHG operation exchanges the values of HL and DE. XTHL exchanges last item pushed on stack with HL. Adding HL to itself performs a 16-bit arithmetic left shift with one instruction. The only 16-bit instruction that affects any flag is DAD (adding BC, DE, HL, or SP to HL), which updates the carry flag to facilitate 24-bit or larger additions and left shifts. Adding the stack pointer to HL is useful for indexing variables in (recursive) stack frames. A stack frame can be allocated using DAD SP and SPHL, and a branch to a computed pointer can be done with PCHL. These abilities make it feasible to compile languages such as [[PL/M]], [[Pascal (programming language)|Pascal]], or [[C (programming language)|C]] with 16-bit variables and produce 8085 machine code. Subtraction and bitwise logical operations on 16 bits is done in 8-bit steps. Operations that have to be implemented by program code (subroutine libraries) include comparisons of signed integers as well as multiplication and division. ====Undocumented instructions==== A number of undocumented instructions and flags were discovered by two software engineers, Wolfgang Dehnhardt and Villy M. Sorensen in the process of developing an 8085 assembler. These instructions use 16-bit operands and include indirect loading and storing of a word, a subtraction, a shift, a rotate, and offset operations.<ref>{{cite journal | first1 = Wolfgang | last1 = Dehnhardt | first2 = Villy | last2 = M. Sorensen | title = Unspecified 8085 op codes enhance programming | journal = Electronics | publisher = McGraw-Hill | date = January 1979 | pages = 144–145 | issn = 0013-5070 | url = http://www.club100.org/memfiles/index.php?action=downloadfile&filename=UnDoc85.pdf&directory=Steve%20Adolph/undocumented_8085_opcodes }}</ref> By the time 8085 was designed but not yet announced, many designers found it to be inferior to the competing products already on the market. The next generation 16-bit 8086 CPU was already in development. Intel made a last minute decision to leave 10 out of 12 new 8085 instructions undocumented to speed up and simplify the design of the upcoming 8086 CPU.<ref> {{cite journal | first1 = Stanley | last1 = Mazor | title = Intel's 8086 | journal = IEEE Annals of the History of Computing | publisher = IEEE Computer Society | date = January–March 2010 | volume = 32 | pages = 75–79 | doi = 10.1109/MAHC.2010.22 | issn = 1058-6180 | url = https://ieeexplore.ieee.org/document/5430762 | url-access = subscription }} </ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)