如何打印出給定尺寸的方格_打印給定號碼的表格| 8086微處理器

如何打印出給定尺寸的方格

Problem statement:

問題陳述:

Write an assembly language program in 8086 to print the table of a given integer.

在8086中編寫匯編語言程序以打印給定整數的表。

Assumptions: Suppose the inputted number is at memory location 500 and the table will be printed from starting location 600 till 609 in hexadecimal.

假設:假設輸入的數字位于存儲位置500,并且表格將從起始位置600到609以十六進制打印。

Algorithm:

算法:

  1. Load input number address in SI and also load the address where we want output in DI .

    在SI中加載輸入數字地址,并在DI中加載我們要輸出的地址。

  2. Store 00 in CH register.

    將00存儲在CH寄存器中。

  3. Increment value of CH by 1 and move the content of [SI] into AH register.

    將CH的值遞增1,然后將[SI]的內容移到AH寄存器中。

  4. Multiply content of AL and CH and store it in AX and then move content of AL into [DI], then increment value of DI by 1.

    將AL和CH的內容相乘并將其存儲在AX中,然后將AL的內容移至[DI],然后將DI的值加1。

  5. Compare the value of CH and 0A, if not equal then go to step number 3 otherwise halt the program.

    比較CH和0A的值,如果不相等,則轉到第3步,否則暫停程序。

Program:

程序:

ADDRESSMNEMONICSCOMMENTS
400MOV SI, 500SI
403MOV DI, 600DI
406MOV CH, 00CH
408INC CHCH
409MOV AL, [SI]AL
40BMUL CHAX
40DMOV [DI], AL[DI]
40FINC DIDI
410CMP CH, 0ACH-0A
413JNZ 408jump to address 408 if zero flag is 0
415HLTTerminates the program
地址 記憶 注釋
400 MOV SI,500 SI
403 MOV DI,600 DI
406 MOV CH,00 CH
408 INC CH CH
409 MOV AL,[SI]
40B UL 斧頭
40D MOV [DI],AL [DI]
40樓 INC DI DI
410 CMP CH,0A CH-0A
413 JNZ 408 如果零標志為0,則跳轉到地址408
415 HLT 終止程序

Explanation:

說明:

  1. MOV SI, 500: load 500 in SI.

    MOV SI,500:在SI中加載500。

  2. MOV DI, 600: load 600 in DI.

    MOV DI,600:在DI中加載600。

  3. MOV CH, 00: load 00 data in CH register.

    MOV CH,00:將00數據加載到CH寄存器中。

  4. INC CH: increment the value inside CH register by 1.

    INC CH:將CH寄存器中的值加1。

  5. MOV AL, SI: move the content of SI into AL register.

    MOV AL,SI:將SI的內容移到AL寄存器中。

  6. MUL CH: multiply the contents of AL and CH register and store in AX register.

    MUL CH:將AL和CH寄存器的內容相乘并存儲在AX寄存器中。

  7. MOV [DI], AL: move the contents of AL register into [DI].

    MOV [DI],AL:將AL寄存器的內容移至[DI]。

  8. INC DI: increment the value of DI by 1.

    INC DI:將DI的值增加1。

  9. CMP CH, 0A: subtract data inside CH register and 0A.

    CMP CH,0A:將CH寄存器和0A內的數據相減。

  10. JNZ 408: jump to address 408 if zero flag is 0.

    JNZ 408:如果零標志為0,則跳轉到地址408。

  11. HLT: terminate the program.

    HLT:終止程序。

翻譯自: https://www.includehelp.com/embedded-system/print-the-table-of-a-given-number-using-8086-microprocessor.aspx

如何打印出給定尺寸的方格

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

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

相關文章

python自動更新excel數據_如何更新Excel數據?(刷新所有查詢)

我有一個帶有一些查詢的Excel xlsm文件。目前我每天打開它,點擊“數據”選項卡中的“全部刷新”命令。我希望這件事能自動完成。我用python編寫了一個腳本(我是python新手)。問題是,刷新數據并保存Excel文件后,刷新的數據不可見(我知道刷新工…

mongoDB 使用手冊

2019獨角獸企業重金招聘Python工程師標準>>> 1、基本操作db.AddUser(username,password) 添加用戶db.auth(usrename,password) 設置數據庫連接驗證db.cloneDataBase(fromhost) 從目標服務器克隆一個數據庫db.commandHelp(name) returns the help for the commanddb.…

android搜索框功能實現_巧用 Trie 樹,實現搜索引擎關鍵詞提示功能

來源 | 碼海責編 | Carol封圖 | CSDN 付費下載于視覺中國我們幾乎每天都在用搜索引擎搜索信息,相信大家肯定有注意過這樣一個細節:當輸入某個字符的時候,搜索引框底下會出現多個推薦詞,如下,輸入「python」后,底下會出…

Python | 從用戶輸入數據,保存到文件,讀取并打印

Here, we have to input the data from the user, to read the data from user, we use input() method, and then the input data we have to store in the file by using write() method and then by using read() method we can get the data. 在這里,我們必須從…

python語句print type 1234的輸出結果是_Python語句 print(type(1J))的輸出結果是

【填空題】遍歷輸出文件所有行。 fopen("d:\\r2.txt","r") while True: str print(str,end) if not str: break f.close()【單選題】執行下列 Python語句將產生的結果是( ) i1 if (i): print(True) else: print( False)【單選題】Python語句 print(type(1/…

qt5.9.0調試如何查看變量的值_深入了解 Java 調試

Bug(俗稱"八阿哥") 是軟件開發繞不過的一道坎,因此調試便成了每位程序員一項必備的核心技能。調試不僅有助于理解程序的運行流程,還能改進代碼質量,最終提高開發者解決問題的能力以及交付軟件的品質。本文旨在討論 Java 調試關鍵技…

python字符串轉浮點數_Python | 打印不同的值(整數,浮點數,字符串,布爾值)...

python字符串轉浮點數In the given example, we are printing different values like integer, float, string and Boolean using print() method in python. 在給定的示例中,我們使用python中的print()方法打印不同的值,例如整數,浮點數&…

(6) 如何用Apache POI操作Excel文件-----POI-3.10的一個和注解(comment)相關的另外一個bug...

如果POI-3.10往一個工作表(sheet)里面插入數據的話,需要注意了,其有一個不太被容易發現的bug。 被插入的工作表(sheet)里面的單元格沒有包含任何的注解(comment)的時候,插…

mysql下拉刷新加載數據_下拉刷新、加載數據功能

paging nick加載更多getData();varm0,n2;//m:button點擊次數 n:一次加載幾條數據$(.page-btn-nick).click(getData);functiongetData(){$.ajax(paging.html).then(function(response){//測試url寫本頁面varobj{developer:[{name:nick},{name:ljy},{name:xzl},{name:jeson},{nam…

mcq 隊列_人工智能邏輯才能問答(MCQ)

mcq 隊列1) Why do we want to implement the concept of Logic in an AI system? So that the agent can have decision making capabilitySo that the agent can think and act humanlySo that the agent can apply the logic for finding the solution to any particular p…

第三周作業!

1、列出當前系統上所有已經登錄的用戶的用戶名,注意:同一個用戶登錄多次,則只顯示一次即可。答:本題思路:先用who命令列出當前登陸的用戶信息,然后使用cut命令對字段進行分割,選出我們需要的字段…

python導入模塊以及類_python模塊的導入以及模塊簡介

標簽: 一、模塊的定義及類型 1、定義 模塊就是用一堆的代碼實現了一些功能的代碼的集合,通常一個或者多個函數寫在一個.py文件里,而如果有些功能實現起來很復雜,那么就需要創建n個.py文件,這n個.py文件的集合就是模塊 …

mysql 指定數字排序_Mysql數據排序

排序數據普通字段排序按照單一字段排序按照多個字段排序手動指定排序順序單個字段手動排序多個字段手動排序普通字段排序按照單一字段排序排序采用order by子句,order by后面跟上排序字段,排序字段可以放多個,多個采用逗號間隔,or…

《黃帝內經 —— 央視60集紀錄片》

下載地址: http://pan.baidu.com/s/1dFI8hxf 目錄 第一部 醫史篇第1集:神奇的秘笈(《黃帝內經》是部什么書)第2集:赫赫始祖(上)(黃帝、炎帝)第3集:赫赫始祖&a…

mnist手寫數字數據集_mnist手寫數據集(1. 加載與可視化)

》》歡迎 點贊,留言,收藏加關注《《1. 模型構建的步驟:在構建AI模型時,一般有以下主要步驟:準備數據、數據預處理、劃分數據集、配置模型、訓練模型、評估優化、模型應用,如下圖所示:【注意】由…

python凱撒密碼實現_密碼:凱撒密碼及其Python實現

python凱撒密碼實現Before we start let’s some basic terminology... 在開始之前,讓我們先介紹一些基本術語... The art and science to achieve security by encoding messages to make them unreadable are known as Cryptography. That’s what the whole art…

qtextedit 默認文案_QT-純代碼控件-QSplitter(分裂器)

版權聲明:本文為博主原創文章,遵循CC 4.0 by-sa版權協議,轉載請附上原文出處鏈接和本聲明。本文鏈接:https://blog.csdn.net/qq_41488943/article/details/96431379使用Qplitter實現頁面的三布局分布1.新建一個無ui界面的工程&…

TYVJ P1030 乳草的入侵 Label:跳馬問題

背景 USACO OCT09 6TH描述 Farmer John一直努力讓他的草地充滿鮮美多汁的而又健康的牧草。可惜天不從人愿&#xff0c;他在植物大戰人類中敗下陣來。邪惡的乳草已經在他的農場的西北部份佔領了一片立足之地。草地像往常一樣&#xff0c;被分割成一個高度為Y(1 < y < 100)…

kotlin中既繼承又實現_Kotlin程序| 解決繼承中的主要沖突的示例

kotlin中既繼承又實現繼承中的主要沖突 (Overriding Conflicts in Inheritance) It may appear, we inherit more than one implementation of the same method. 看來&#xff0c;我們繼承了同一方法的多個實現。 Need to implement all the methods which we have inherited f…

python雷達圖詳解_Python簡單雷達圖繪制

import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams[font.family] SimHei matplotlib.rcParams[font.sans-serif] [SimHei] lables np.array([綜合,KDA,發育,推進,生存,輸出]) nAttr 6 date np.array([7, 5, 6, 9, 8, 7]) angles…