日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

如何打印出给定尺寸的方格_打印给定号码的表格| 8085微处理器

發布時間:2025/3/11 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 如何打印出给定尺寸的方格_打印给定号码的表格| 8085微处理器 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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

Problem statement:

問題陳述:

Write an assembly language program in 8085 to print the table of input integer.

在8085中編寫匯編語言程序以打印輸入整數表。

Assumptions: Suppose the inputted number is at memory location 2050 and the table will be printed from starting location 3050.

假設:假設輸入的數字位于內存位置2050,并且將從起始位置3050開始打印表格。

Algorithm:

算法:

  • Load the value of input in accumulator from memory location 2050 and then copy it to another register say D. Also store 0A in register B.

    從存儲器位置2050將輸入的值加載到累加器中,然后將其復制到另一個寄存器D中。還將0A存儲在寄存器B中。

  • Store memory location 3050 in M using LXI instruction and take another register say C with its value 00.

    使用LXI指令將存儲單元3050存儲在M中,并取另一個值為C的寄存器C。

  • Now copy the content of D register to A and add the contents of A and C and store it in A then copy it to M.

    現在將D寄存器的內容復制到A,并將A和C的內容相加并存儲在A中,然后將其復制到M。

  • Increment value of M by 1.

    M的值增加1。

  • Copy content of A to C and decrements the content of B by 1 and if its value is 0 then halt otherwise again go to step number 3.

    將A的內容復制到C,并將B的內容減1,如果B的值為0,則暫停,否則再次轉到步驟3。

  • Program:

    程序:

    ADDRESSMNEMONICSCOMMENTS
    2000LDA 2050A
    2003MOV D, AD
    2004MVI B 0AB
    2006LXI H 3050H
    2009MVI C 00C
    200BMOV A, DA
    200CADD CA
    200DMOV M, AM
    200EINX HHL
    200FMOV C, AC
    2010DCR BB
    2011JNZ 200BJump to address 200B if ZF=0
    2014HLTTerminates the program
    地址 記憶 注釋
    2000 LDA 2050 一個
    2003年 MOV D,A d
    2004年 MVI B 0A
    2006年 LXI H 3050 H
    2009年 MVI C 00 C
    200B MOV A,D 一個
    200度 加C 一個
    200D MOV M,A 中號
    200E INX H HL
    200樓 MOV C,A C
    2010 DCR B
    2011年 JNZ 200B 如果ZF = 0,則跳轉到地址200B
    2014年 HLT 終止程序

    Explanation:

    說明:

  • LDA 2050: load the contents from 2050 memory location to accumulator (register A).

    LDA 2050:將內容從2050存儲器位置加載到累加器(寄存器A)。

  • MOV D, A: move the contents of accumulator to register D.

    MOV D,A:將累加器的內容移至寄存器D。

  • MVI B 0A: store 0A data into register B.

    MVI B 0A:將0A數據存儲到寄存器B中。

  • LXI H 3050: store 30 in H register and 50 in L register; hence M will contain 3050 inside it.

    LXI H 3050:在H寄存器中存儲30,在L寄存器中存儲50; 因此M內含3050。

  • MVI C 00: store 00 data in register C.

    MVI C 00:將00數據存儲在寄存器C中。

  • MOV A, D: move the contents of D register into A.

    MOV A,D:將D寄存器的內容移至A。

  • ADD C: add the contents of A and C register and store in A.

    添加C:將A和C寄存器的內容相加并存儲在A中。

  • MOV M, A: move the contents of A register into M.

    MOV M,A:將A寄存器的內容移到M。

  • INX H: increments content of M by 1.

    INX H:將M的內容增加1。

  • MOV C, A: move the contents of A register into C.

    MOV C,A:將A寄存器的內容移至C。

  • DCR B: decrements the content of B register by 1.

    DCR B:將B寄存器的內容減1。

  • JNZ 200B: jump to address 200B if Carry flag is not zero.

    JNZ 200B:如果進位標志不為零,則跳轉到地址200B。

  • HLT: terminate the program.

    HLT:終止程序。

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

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

    創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

    總結

    以上是生活随笔為你收集整理的如何打印出给定尺寸的方格_打印给定号码的表格| 8085微处理器的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。