计算机体系结构实验报告——实验三
1.实验目的:
通过实验,熟练掌握WINDLX的操作方法,特别注意在单步执行WinDLX程序中,流水线中指令的节拍数。
2.实验内容:
(1)用WinDLX模拟器执行求素数程序prim.s。这个程序计算若干个整数的素数。
(2)单步执行两轮程序,求出素数2和3。
(3)在执行程序过程中,注意体验单步执行除法和乘法指令的节拍数,并和主菜单configuration/floating point slages中的各指令执行拍数进行比较。
3.实验程序
求素数程序prim.s。
;***********WINDLX Exp.2:Generate prime number table*************
;-------------------------------------------------------------------
;Program begins at symbol main
;generates a table with the first'Count'prime numbers from'Table'
;-------------------------------------------------------------------
.data
;***size of table
.global Count
Count:.word10;10的地址值
.global Table
Table:.space Count*4;给Table保留Count*4个字节
.text
.global main
main:
;***Initialization