内存和汇编语言/操作系统

时间:2013-11-20 04:12:43

标签: assembly system

以下问题是关于我对操作系统的测试评论,但我不知道如何回答。我会首先尝试解决这些问题,但我真的不知道如何启动它。

Given the following information for an assembly language program:

Process code size = 3126 bytes, Page size = 1042 bytes

Instruction at memory location 532:  Load 1, 2098

Instruction at memory location 1156:  Add 1, 4087

Instruction at memory location 2086:  Sub 1, 1052

Data at memory location 1052:  015672

Data at memory location 2098:  114321

Data at memory location 4087:  077435

(a) How many pages are needed to store the entire process code?
Show calculations.

(b) Compute the page number and displacement for each of the byte
e byte
addresses where the data is stored (recall that page numbering
starts at 0).

(c) Are page numbers and displacements legal for this process?
Explain.

1 个答案:

答案 0 :(得分:3)

A - 给定Process code size = 3126 bytes, Page size = 1042 bytes然后是 页数= process code size / page size
页数= 3

B - 1052 =第1页(或第二页),排量= 10 1052 = 1042 + 10
2098 =第2页(或第3页),位移= 14 2098 = (1042 * 2) + 14
4087 =第3页(或第四页),displacement = 961 4087 = (1042 * 3) + 961

C - 不太可能。 4087似乎远远超过了进程大小(例如,961字节)。但是,这取决于您的平台。