gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 04:33:57 36 4
gpt4 key购买 nike

以下问题是我对操作系统的测试评论,但我不知道如何回答。我会第一次尝试解决他们的问题,但我也不知道如何开始。

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.

最佳答案

一个 - 给定 Process code size = 3126 bytes, Page size = 1042 bytes那么
页数 = process code size/page size页数 = 3
- 1052 = 第 1 页(或第二页),位移 = 10 1052 = 1042 + 102098 = 第 2 页(或第三页),位移 = 14 2098 = (1042 * 2) + 144087 = 第 3 页(或第四页),位移 = 961 4087 = (1042 * 3) + 961
C - 不太可能。 4087 似乎远远超过进程大小(例如 961 字节)。但是,这取决于您的平台。

关于assembly - 内存和汇编语言/操作系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20087185/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com