Principles of Computer Composition and Assembly Language Experiments and Course Design Source Code Sharing

0. Environment

DOSBox0.74 + 8086

1. Computer composition principle and assembler program design experiment

1.    Write a cumulative addition, add from  1  to  5 , and save the result to  AX  .

2. Write a cumulative subtraction, the minuend is  10011000B , the subtrahend is  01000000B , subtract  5  times in a row, and observe  the change of FLAGS 

3.    Write a  16  -bit multiplication, the multiplicand is  100H , the multiplier is  100H , observe the change of  Flags  , write a  32  -bit multiplication, the multiplicand is  0F0FH , the multiplier is  FF00H , and observe  the change of Flags . 

4.    Write a  16  -bit division, the dividend is  100H , the divisor is  100H , observe the change of  Flags  , write a  32-  bit division, the dividend is  0F0FH , the divisor is  00FFH , and observe  the change of Flags . 

5. Write a cumulative addition, the summand is  0FH , the addend is  01H , observe the change of  Flags  , the summand is  0FFH , the addend is  01H , observe the change of  Flags  , the summand is  0FFFH , the addend is  01H , Observe the change of  Flags  , the summand is  FFFFH , the addend is  01H , observe  the change of Flags , the  summand is FFFFFFFFH and the addend is 01H , observe the change of Flags .     

6.    Write a shift operation, save  8F1DH  to  AX , then use the instruction to shift right by  1  bit and then left by  1  bit, display the result and observe the change of  Flags  . Store  8F1DH  in  AX  , then shift left by  5 bits with CF  bit  , and shift right by 7 bits, observe the change of Flags , and give the result.    

7. Save  71D2H  to  AX  , 5DF1H  to  CX  , DST  to  AX , REG  to  AX , realize double-precision right shift  2  times, exchange  DST  and  REG , then left shift  4  times, and check the results respectively .

8. Realize    the addition and subtraction of compressed BCD codes,  use compressed BCD codes to realize ( 21+71 ) ( , 12+49 ) (, 65+82 ) , ( 46-33 ), ( 74-58 ) , , ( 43- 54 ) decimal addition and subtraction. Then use non-compressed BCD to realize the above 6 formulas.     

9. Realize the  KMP  algorithm, input two character strings (which can be directly stored in the memory) to achieve fast matching

10.   Fibonacci sequence: 1 , 1 , 2 , 3 , 5 , 8 , 13 . Usually it can be realized by using recursive function, and the process is now realized by assembly.

2. Principles of Computer Composition and Assembly Program Design Course Design

1. Realize quick sort, heap sort, bubble sort;
2. Realize the addition and subtraction of 100 -bit integers;
3. Input a positive integer (1~65535) representing the year from the keyboard , and then judge whether it is a leap year. like
If yes, output "Yes" , otherwise, output "No" .
4. Assembly realizes the generation, addition, and deletion operations of the linked list,
5. Compile and implement the adjacency list structure of the graph, generate a graph, and obtain its minimum spanning tree according to the graph.

3. Source code sharing

1. csdn resources

Principles of Computer Composition and Assembly Language Experiments and Course Design Source Code Sharing - Other Documentation Resources - CSDN Library https://download.csdn.net/download/m0_46749624/85228858

2. Baidu Cloud

Link: https://pan.baidu.com/s/1ot7Z8vX410zSfAhQ2Sbo9w
Extraction code: zy12

Guess you like

Origin blog.csdn.net/m0_46749624/article/details/124440793