Hi everyone, I've a problem I want some help with. "For the figure in the attachments, write a code to make the values of the third chip all zeros, and copy the contents of the first chip to sixth and the seventh." I want you to help me with first steps to solve this problem.
Where exactly are you stuck? Do you understand the question? Have you figured out what value(s) of A16-A19 you need to enable the chip? If there were no custom hardware and you were just doing the same kind of thing with eight consecutive 8K blocks of RAM in a PC, do you know how you would solve the problem?
Hi xpi0t0s, Thank you for your response. I understand that A16-A19 should be High all the time. I the first and the last addresses of all chips. Code: [B]Chip No.[/B] [B]First Add.[/B] [B]Last Add.[/B] 1 E0000h E1FFFh 2 E2000h E3FFFh 3 E4000h E5FFFh 4 E6000h E7FFFh 5 E8000h E9FFFh 6 EA000h EBFFFh 7 EC000h EDFFFh 8 EE000h EEFFFh What I need to know is how access these locations "programically". I mean, I know that (Physical Address)=(Logical Address)*10h+(Offset), how can I determine the offset I need?
I've found this page. (in attachments) I'm guessing it'll lead me to solve this problem. Can you help me understand it?
>>(Physical Address)=(Logical Address)*10h+(Offset) Logical Address is also sometimes known as a segment. Might be easier to think of in those terms. You're going to be looping over 8K blocks, so it makes sense for the offset to be at least 13 bits (A0-A12). There's more than one way to do it (in fact there are 16 ways to do it...EDIT: scratch that, there are loads more than 16). With 13-bit offset addresses your segments are going to be at E000, E200, E400 etc and you'll need to use 3 segment registers to do the copy, i.e. copying from E0xxx to EAxxx and ECxxx. Clearing chip 3 is just a case of writing zeros from 0-1fff in segment E400. Alternatively since 8*8K fits into 64K you could do the whole lot as one 64K segment at E000 and include the chip address in the upper 3 bits of the offset. The first might be easier, and in fact might be how the exercise is intended to get you thinking.
Depending on an example in the attachment, I did the following: Code: ;A program to make the addresses values' from E4000 to E5FFF equal to zero MOV AX,E400h MOV DS,AX MOV BX,0000h here: MOV [BX],0000h INC BX CMP BX, 1FFFh JBE here hlt
Looks OK. The only thing I would check if you're using the 16-bit mov[bx] (because you specified 0000h, not 00h), this writes 2 bytes: one to [bx] and one to [bx+1], so you're duplicating almost all writes, which is unnecessary. Secondly check if the loop includes or excludes the write to [1fff], because if this write is included then this will mean the 16-bit write will write to [2000], which is the 1st byte of the next memory chip (and further if you switch to the 8-bit write then make sure the write to [1fff] is definitely included. Boundary conditions always need checking).
Here's my code. Code: ;A program to make the addresses values' from E4000 to E5FFF equal to zero MOV AX,E400h MOV DS,AX MOV BX,0000h here: MOV [BX],0000h INC BX CMP BX, 1FFFh JBE here ;Copying the 4th address' value of the 1st chip to DL MOV BX,0003h MOV DX,[BX] ;Copying the 4th address' value of the 1st chip to the 6th chip MOV AX,EA00h MOV DS,AX MOV BX,0000h there: MOV [BX],DX INC BX CMP BX,1FFFh JBE there ;Copying the 4th address' value of the 1st chip to the 7th chip MOV AX,EC00h MOV DS,AX MOV BX,0000h over: MOV [BX],DX INC BX CMP BX,1FFFh JBE over HLT I think I've some solution, which is to initially copy the "out of bound" addresses' values to some low registers and then returning them back.
xpi0t0s, I've just mispelled, it's actually "the 4th address' value of the 1st chip". So going back to the code, is my approach acceptable?