1) In the previous page we discussed that every physical address can be referenced my thousands of logical addresses. However, there are a few exceptions. In fact, there are 16 physical address that can be referenced by only one logical address. Can you identify them?
2) What is the largest possible physical addressed that can be referenced in real mode? How many MB of memory can be accessed? (This problem should illustrate the rationale behind the infamous 1 MB limit).
3)How many unique logical addresses can reference physical address 179b8? Which other physical address can be referenced by the same number of logical addresses? Why is it impossible for any physical address to be referenced by more logical addresses than the address 179b8?
4) Consider the following code designed to fill a hundred-thousand -byte buffer of memory with zeros. The starting address of the buffer is represented by ds:[0].
;ds:[0] contains buffer
;fill first 64K bytes
mov di,0 ;line 1
Loop1: ;line 2
mov byte ptr ds:[di],0 ;line 3
inc di ;line 4
cmp di,0 ;line 5
jne Loop1 ;line 6
;increment ds to get to next bytes ;line 7
mov ax,ds ;line 8
inc ax ;line 9
mov ds,ax ;line 10
;remaining bytes ;line 11
mov di,0 ;line 12
Loop2: ;line 13
mov byte ptr ds:[di],0 ;line 14
inc di ;line 15
cmp di,100000-65536 ;line 16
jne Loop2 ;line 17
;done
The above code has a serious flaw in it that prevents it from doing what it is supposed to do. Try to figure out the flaw (the background information should serve as a hint) and a way to remedy it.
|
Back to table of contents |   | Chapter 1 | Chapter 2 | Chapter 3 |   | Further Information |