php 随机两位小数数_使用8086微处理器找出两个8位N数数组
php 隨機兩位小數數
Problem statement:
問題陳述:
Write a program in 8086 microprocessor to find out the sum of two arrays of 8-bit n numbers, where size “n” is stored at offset 500 and the numbers of first array are stored from offset 501 and the numbers of second array are stored from offset 601 and store the result numbers into first array i.e offset 501.
在8086微處理器中編寫程序,以找出兩個8位n個數字數組的總和,其中大小“ n”存儲在偏移500中,第一個數組的數字從偏移501開始存儲,第二個數組的數字被存儲從偏移量601開始并將結果編號存儲到第一數組,即偏移量501中。
Algorithm:
算法:
Store 500 to SI and 601 to DI and Load data from offset 500 to register CL and set register CH to 00 (for count).
將500存儲到SI中,將601存儲到DI中,并將數據從偏移量500加載到寄存器CL中,并將寄存器CH設置為00(用于計數)。
Increase the value of SI by 1.
將SI的值增加1。
Load first number (value) from next offset (i.e 501) to register AL.
從下一個偏移量(即501)加載第一個數字(值)到寄存器AL。
Add the value in register AL by value at offset DI.
將寄存器AL中的值與偏移量DI處的值相加。
Store the result (value of register AL ) to memory offset SI.
將結果(寄存器AL的值)存儲到存儲器偏移SI中。
Increase the value of SI by 1.
將SI的值增加1。
Increase the value of DI by 1.
將DI的值增加1。
Loop above 5 till register CX gets 0.
在5以上循環直到寄存器CX變為0。
Program:
程序:
| 400 | MOV SI, 500 | SI←500 |
| 403 | MOV CL, [SI] | CL←[SI] |
| 405 | MOV CH, 00 | CH←00 |
| 407 | INC SI | SI←SI+1 |
| 408 | MOV DI, 601 | DI←601 |
| 40B | MOV AL, [SI] | AL←[SI] |
| 40D | ADD AL, [DI] | AL=AL+[DI] |
| 40F | MOV [SI], AL | AL->[SI] |
| 411 | INC SI | SI←SI+1 |
| 412 | INC DI | DI←DI+1 |
| 413 | LOOP 40B | JUMP TO 40B IF CX!=0 and CX=CX-1 |
| 415 | HLT | end |
| 400 | MOV SI,500 | SI←500 |
| 403 | MOV CL,[SI] | CL←[SI] |
| 405 | MOV CH,00 | CH←00 |
| 407 | INC SI | SI←SI + 1 |
| 408 | MOV DI,601 | DI←601 |
| 40B | MOV AL,[SI] | AL←[SI] |
| 40D | 添加AL,[DI] | AL = AL + [DI] |
| 40樓 | MOV [SI],AL | AL-> [SI] |
| 411 | INC SI | SI←SI + 1 |
| 412 | INC DI | DI←DI + 1 |
| 413 | 圈40B | 如果CX!= 0和CX = CX-1則跳至40B |
| 415 | HLT | 結束 |
Explanation
說明
MOV SI, 500: set the value of SI to 500
MOV SI,500 :將SI的值設置為500
MOV CL, [SI]: load data from offset SI to register CL
MOV CL,[SI] :將數據從偏移SI加載到寄存器CL
MOV CH, 00: set value of register CH to 00
MOV CH,00 :將寄存器CH的值設置為00
INC SI: increase value of SI by 1.
INC SI :將SI的值增加1。
MOV DI, 600: set the value of DI to 600.
MOV DI,600 :將DI的值設置為600。
MOV AL, [SI]: load value from offset SI to register AL
MOV AL,[SI] :從偏移量SI到寄存器AL的加載值
ADD AL, [DI]: Add value of register AL by content at offset DI.
ADD AL,[DI] :將寄存器AL的值與偏移量DI處的內容相加。
MOV [SI], AL: store value of register AL at offset SI.
MOV [SI],AL :將寄存器AL的值存儲在偏移SI處。
INC SI: increase value of SI by 1.
INC SI :將SI的值增加1。
INC DI: increase value of DI by 1.
INC DI :DI的值增加1。
LOOP 408: jump to address 408 if CX not 0 and CX=CX-1.
循環408 :如果CX不為0并且CX = CX-1,則跳轉到地址408。
HLT: stop
HLT :停止
翻譯自: https://www.includehelp.com/embedded-system/find-sum-of-two-arrays-of-8-bits-n-numbers-using-8086-microprocessor.aspx
php 隨機兩位小數數
總結
以上是生活随笔為你收集整理的php 随机两位小数数_使用8086微处理器找出两个8位N数数组的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 错误:使用printf()打印Hello
- 下一篇: duration java_Java D