標志寄存器_訪問標志寄存器,并與寄存器B |交換標志寄存器F的內容 8085微處理器...

標志寄存器

Problem statement:

問題陳述:

Write an assembly language program in 8085 microprocessor to access Flag register and exchange the content of flag register F with register B.

在8085微處理器中編寫匯編語言程序以訪問標志寄存器,并與寄存器B交換標志寄存器F的內容。

Assumptions: Initial values of flag register, register B and stack pointer are 00, 3F, and 3FFF respectively.

假設:標志寄存器,寄存器B和堆棧指針的初始值分別為00、3F和3FFF。

PSW stands for PROGRAM STATUS WORD. PSW combines accumulator A and flag register F.

PSW代表程序狀態字。 PSW將累加器A和標志寄存器F組合在一起。

Algorithm:

算法:

  1. Push the value of PSW in memory stack by help of PUSH instruction

    通過PUSH指令將PSW的值壓入存儲器堆棧

  2. Pop the value of Flag register and store it in register H by help of POP instruction

    彈出標志寄存器的值,并借助POP指令將其存儲在寄存器H中

  3. Move the value of register H in register C

    將寄存器H的值移到寄存器C中

  4. Move the value of register B in register H

    將寄存器B的值移到寄存器H中

  5. Move the value of register C in register B

    將寄存器C的值移到寄存器B中

  6. Push the value of register H in memory stack by help of PUSH instruction

    通過PUSH指令將寄存器H的值壓入存儲器堆棧

  7. Pop the value of PSW from memory stack using POP instruction

    使用POP指令從存儲器堆棧中彈出PSW的值

Program:

程序:

ADDRESSMNEMONICSCOMMENTS
2000PUSH PSWPush value of accumulator and flag in stack
2001POP HPop value from TOP of memory stack in H
2002MOV C, HC ← H
2003MOV H, BH ← B
2004MOV B, CB ← C
2005PUSH HPush the value of register H
2006POP PSWPop value of flag register and Accumulator
2007HLTEND
地址 記憶 注釋
2000 推PSW 將累加器的值和標志壓入堆棧
2001 POP H 從H中的內存堆棧的TOP彈出值
2002年 MOV C,H C←H
2003年 MOV H,B H←B
2004年 MOV B,C B←C
2005年 推H 推送寄存器H的值
2006年 POP PSW 標志寄存器和累加器的彈出值
2007年 HLT 結束

Explanation – Registers used A, B, C, H, F

說明–使用的寄存器A,B,C,H,F

  1. PUSH PSW instruction performs the following task:

    PUSH PSW指令執行以下任務:

    • SP ← SP - 1
    • M[SP] ← A
    • SP ← SP - 1
    • M[SP] ← F
  2. POP H instruction performs the following task:

    POP H指令執行以下任務:

    • H ← M[SP]
    • SP ← SP + 1
  3. MOV C, H – moves the value of H in register C

    MOV C,H –將H的值移動到寄存器C中

  4. MOV H, B – moves the value of B in register H, hence H is updated

    MOV H,B –移動寄存器H中B的值,因此H被更新

  5. MOV B, C – moves the value of C in register B, hence B is updated

    MOV B,C –移動寄存器B中C的值,因此B被更新

  6. PUSH H performs the following task:

    PUSH H執行以下任務:

    • SP ← SP - 1
    • M[SP] ← H
  7. POP PSW performs the following task:

    POP PSW執行以下任務:

    • F ← M[SP]
    • SP ← SP + 1
    • A ← M[SP]
    • SP ← SP + 1
  8. HLT – stops executing the program and halts any further execution

    HLT –停止執行程序,并停止任何進一步的執行

翻譯自: https://www.includehelp.com/embedded-system/access-flag-register-and-exchange-the-content-of-flag-register-f-with-register-b-using-8085-microprocessor.aspx

標志寄存器

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/540514.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/540514.shtml
英文地址,請注明出處:http://en.pswp.cn/news/540514.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

瀏覽器端已支持 ES6 規范(包括 export import)

當然,是幾個比較優秀的瀏覽器,既然是優秀的瀏覽器,大家肯定知道是那幾款啦,我就不列舉了,我用的是 chrome。 對 script 聲明 type 為 module 后就可以享受 es6 規范所帶來的模塊快感了。 基礎語法既然是全支持&#xf…

[轉載] Python學習:Python成員運算符和身份運算符

參考鏈接: Python中和is運算符之間的區別 Python成員運算符 除了以上的一些運算符之外,Python還支持成員運算符,測試實例中包含了一系列的成員,包括字符串,列表或元組。 運算符 描述 實例 in 如果在指定的序列中找…

量詞邏輯量詞里面的v表示?_代理知識表示中的量詞簡介(基于人工智能)

量詞邏輯量詞里面的v表示?As we know that in an AI-based agent, the knowledge is represented through two types of logic: The propositional logic and the predicate logic. In the propositional logic, we have declarative sentences, and in the predica…

[轉載] Python 機器學習經典實例

參考鏈接: Python中的邏輯門 內容介紹 在如今這個處處以數據驅動的世界中,機器學習正變得越來越大眾化。它已經被廣泛地應用于不同領域,如搜索引擎、機器人、無人駕駛汽車等。本書首先通過實用的案例介紹機器學習的基礎知識,然后…

哈希表的最差復雜度是n2_給定數組A []和數字X,請檢查A []中是否有對X | 使用哈希O(n)時間復雜度| 套裝1...

哈希表的最差復雜度是n2Prerequisite: 先決條件: Hashing data structure 散列數據結構 Problem statement: 問題陳述: Given an array and a sum X, fins any pair which sums to X. Expected time complexity O(n). 給定一個數組和一個和X &#xff…

一文讀懂深度學習框架下的目標檢測(附數據集)

從簡單的圖像分類到3D位置估算,在機器視覺領域里從來都不乏有趣的問題。其中我們最感興趣的問題之一就是目標檢測。 如同其他的機器視覺問題一樣,目標檢測目前為止還沒有公認最好的解決方法。在了解目標檢測之前,讓我們先快速地了解一下這個領…

[轉載] Python-Strings

參考鏈接: Python成員資格和身份運算符 | in, not in, is, is not Strings 介紹 String是Python中最常用的類型。僅僅用引號括起字符就可以創建string變量。字符串使用單引號或雙引號對Python來說是一樣的。 var1 Hello World! var2 "Pyth…

aes-128算法加密_加密算法問題-人工智能中的一種約束滿意問題

aes-128算法加密The Crypt-Arithmetic problem in Artificial Intelligence is a type of encryption problem in which the written message in an alphabetical form which is easily readable and understandable is converted into a numeric form which is neither easily…

讀書筆記《集體智慧編程》Chapter 2 : Make Recommendations

本章概要本章主要介紹了兩種協同過濾(Collaborative Filtering)算法,用于個性化推薦:基于用戶的協同過濾(User-Based Collaborative Filtering,又稱 K-Nearest Neighbor Collaborative Filtering&#xff0…

[轉載] python中的for循環對象和循環退出

參考鏈接: Python中循環 流程控制-if條件 判斷條件,1位true,0是flesh,成立時true,不成立flesh,not取反 if 1; print hello python print true not取反,匹配取反,表示取非1…

設計一個應用程序,以在C#中的按鈕單擊事件上在MessageBox中顯示TextBox中的文本...

Here, we took two controls on windows form that are TextBox and Button, named txtInput and btnShow respectively. We have to write C# code to display TextBox’s text in the MessageBox on Button Click. 在這里,我們在Windows窗體上使用了兩個控件&…

Oracle優化器:星型轉換(Star Query Transformation )

Oracle優化器:星型轉換(Star Query Transformation )Star query是一個事實表(fact table)和一些維度表(dimension)的join。每個維度表都跟事實表通過主外鍵join,且每個維度表之間不j…

[轉載] python循環中break、continue 、exit() 、pass的區別

參考鏈接: Python中的循環和控制語句(continue, break and pass) 1、break:跳出循環,不再執行 用在while和for循環中 用來終止循環語句,即循環條件沒有False條件或者序列還沒被完全遞歸完,也會停止執行循環語句 如果…

JavaScript | 聲明數組并使用數組索引分配元素的代碼

Declare an array, assign elements by indexes and print all elements in JavaScript. 聲明一個數組&#xff0c;通過索引分配元素&#xff0c;并打印JavaScript中的所有元素。 Code: 碼&#xff1a; <html><head><script>var fruits [];fruits[0]"…

[轉載] Python入門(輸入/輸出、數據類型、條件/循環語句)

參考鏈接&#xff1a; Python中的循環技術 在介紹之前我們先來看看計算機的三個根本性基礎&#xff1a; 1.計算機是執行輸入、運算、輸出的機器 2.程序是指令和數據的集合 3.計算機的處理方式有時與人們的思維習慣不同 &#xff08;以上是引自《計算機是怎樣跑起來的》…

第5章 函數與函數式編程

第5章 函數與函數式編程 凡此變數中函彼變數者&#xff0c;則此為彼之函數。 ( 李善蘭《代數學》) 函數式編程語言最重要的基礎是λ演算&#xff08;lambda calculus&#xff09;&#xff0c;而且λ演算的函數可以傳入函數參數&#xff0c;也可以返回一個函數。函數式編程 (簡稱…

mcq 隊列_人工智能能力問答中的人工智能概率推理(MCQ)

mcq 隊列1) Which of the following correctly defines the use of probabilistic reasoning in AI systems? In situations of uncertainty, probabilistic theory can help us give an estimate of how much an event is likely to occur or happen.It helps to find the pr…

[轉載] Python中的xrange和range的區別

參考鏈接&#xff1a; Python中的range()和xrange() 在python2 中 range(start,end,step)返回一個列表&#xff0c;返回的結果是可迭代對象&#xff0c;但不是迭代器。iter()轉化為列表迭代器。xrange()返回的是一個序列&#xff0c;他也是可迭代對象&#xff0c;但不是迭代…

Kubernetes基礎組件概述

本文講的是Kubernetes基礎組件概述【編者的話】最近總有同學問Kubernetes中的各個組件的相關問題&#xff0c;其實這些概念內容在官方文檔中都有&#xff0c;奈何我們有些同學可能英文不好&#xff0c;又或者懶得去看&#xff0c;又或者沒有找到&#xff0c;今天有時間就專門寫…

c語言將鏈表寫入二進制文件_通過逐級遍歷將二進制樹轉換為單鏈表的C程序

c語言將鏈表寫入二進制文件Problem statement: Write a C program to convert a binary tree into a single linked list by traversing level-wise. 問題陳述&#xff1a;編寫一個C程序&#xff0c;通過逐級遍歷將二進制樹轉換為單個鏈表 。 Example: 例&#xff1a; The ab…