Microprocessor-8085-instruction-sets

提供:Dev Guides
移動先:案内検索

マイクロプロセッサ-8085命令セット

8085マイクロプロセッサのプログラミングを見てみましょう。

命令セットは、いくつかのタスクを実行するための命令コードです。 5つのカテゴリに分類されます。

S.No. Instruction & Description
1

Control Instructions

以下は、制御命令のリストとその意味を示す表です。

2

Logical Instructions

以下は、論理命令のリストとその意味を示す表です。

3

Branching Instructions

以下は、分岐命令のリストとその意味を示す表です。

4

Arithmetic Instructions

以下は、算術命令のリストとその意味を示した表です。

5

Data Transfer Instructions

以下は、データ転送命令のリストとその意味を示した表です。

8085 –デモプログラム

今、私たちは上記の指示を使用していくつかのプログラムのデモを見てみましょう-

2つの8ビット数を追加する

3005Hおよび3006Hのメモリ位置にデータを追加し、結果を3007Hのメモリ位置に保存するプログラムを作成します。

問題のデモ-

(3005H) = 14H
   (3006H) = 89H

結果-

14H+ 89H = 9DH

プログラムコードは次のように書くことができます-

LXI H 3005H   : "HL points 3005H"
MOV A, M      : "Getting first operand"
INX H         : "HL points 3006H"
ADD M         : "Add second operand"
INX H         : "HL points 3007H"
MOV M, A      : "Store result at 3007H"
HLT           : "Exit program"

メモリ位置の交換

5000Mおよび6000Mのメモリー位置でデータを交換するプログラムを作成します。

LDA 5000M   : "Getting the contents at5000M location into accumulator"
MOV B, A    : "Save the contents into B register"
LDA 6000M   : "Getting the contents at 6000M location into accumulator"
STA 5000M   : "Store the contents of accumulator at address 5000M"
MOV A, B    : "Get the saved contents back into A register"
STA 6000M   : "Store the contents of accumulator at address 6000M"

番号を昇順に並べる

メモリアドレス3000Hから最初の10個の数字を昇順で並べるプログラムを作成します。

MVI B, 09         :"Initialize counter"
START             :"LXI H, 3000H: Initialize memory pointer"
MVI C, 09H        :"Initialize counter 2"
BACK: MOV A, M    :"Get the number"
INX H             :"Increment memory pointer"
CMP M             :"Compare number with next number"
JC SKIP           :"If less, don’t interchange"
JZ SKIP           :"If equal, don’t interchange"
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H             :"Interchange two numbers"
SKIP:DCR C        :"Decrement counter 2"
JNZ BACK          :"If not zero, repeat"
DCR B             :"Decrement counter 1"
JNZ START
HLT               :"Terminate program execution"