scommstech
Experienced Member
- Joined
- Jul 16, 2007
- Messages
- 69
HI
Can anybody throw some light on this 8088 programming problem
I’m assembling some code to write the pattern AA into memory location
0 to 16 and then read it back. The code will be in an EPROM in the BIOS slot.
This is a diagnostic program to run on power up instead of the BIOS.
I thought that as the routine is only addressing 16 locations the lack of
memory refresh should not be a problem. All done in less than 3MS. And the
8088 itselfwill not have reserved base memory for itself.
I’m using stosb to write the pattern AA into the first 16 memory locations,
and am using mov dl,[si] to read back the AA from each memory location in
turn. I’m then doing a compare of dl and al after each read, as al should still
have AA in it from the previous write operation.
I’ve used EMU8086 to assemble the code and it assembles ok.
The write part runs ok but the first read back shows a different pattern to
AA in the dl register..
I’ve included the code I’m using. If somebody can spot my mistake I’d be
very grateful. Ps its only an amateurs attempt.
START
Code to set up direction and stop interrupts then :--
Mov ax,00 Put 0 in ax
Mov ds,ax Make data segment = 0
Sub di,di make write offset = 0
Mov al,0AAH put pattern in al
Mov cx,0FH set up count for 16
Rep
Stosb write AA into 16 memory locations starting at 00
The above bit appears to run ok It’s the next bit that has problems
Mov cx,0FH reset the counter for 16 (not sure if I need to )
Mov si,0FH set the read offset to the last memory written to
FRED: Mov dl,[si] get the AA from memory – put in dl
Cmp al,dl should still have AA so if good read compare = 0
Jz BILL good compare, go set up for next memory location
Hlt. Stops here if al not same as dl
BILL: Mov dl,0 clear dl for next read
Dec si set read offset to next location down
Dec cx decrement the counter
Cmp cx.0 check if all 16 location done
Jz START yes do all again
Jmp FRED not done yet
The assembler halts at the halt after the jz BILL instruction. Dl contains F4
not AA I don’t know if an EMU8086 assembler has any protected memory
but an assembled program should only be using virtual memory so shouldn’t
actually access memory 00. Maybe I’m wrong.
Anybody got any ideas.
Regards
Scommstech
Can anybody throw some light on this 8088 programming problem
I’m assembling some code to write the pattern AA into memory location
0 to 16 and then read it back. The code will be in an EPROM in the BIOS slot.
This is a diagnostic program to run on power up instead of the BIOS.
I thought that as the routine is only addressing 16 locations the lack of
memory refresh should not be a problem. All done in less than 3MS. And the
8088 itselfwill not have reserved base memory for itself.
I’m using stosb to write the pattern AA into the first 16 memory locations,
and am using mov dl,[si] to read back the AA from each memory location in
turn. I’m then doing a compare of dl and al after each read, as al should still
have AA in it from the previous write operation.
I’ve used EMU8086 to assemble the code and it assembles ok.
The write part runs ok but the first read back shows a different pattern to
AA in the dl register..
I’ve included the code I’m using. If somebody can spot my mistake I’d be
very grateful. Ps its only an amateurs attempt.
START
Code to set up direction and stop interrupts then :--
Mov ax,00 Put 0 in ax
Mov ds,ax Make data segment = 0
Sub di,di make write offset = 0
Mov al,0AAH put pattern in al
Mov cx,0FH set up count for 16
Rep
Stosb write AA into 16 memory locations starting at 00
The above bit appears to run ok It’s the next bit that has problems
Mov cx,0FH reset the counter for 16 (not sure if I need to )
Mov si,0FH set the read offset to the last memory written to
FRED: Mov dl,[si] get the AA from memory – put in dl
Cmp al,dl should still have AA so if good read compare = 0
Jz BILL good compare, go set up for next memory location
Hlt. Stops here if al not same as dl
BILL: Mov dl,0 clear dl for next read
Dec si set read offset to next location down
Dec cx decrement the counter
Cmp cx.0 check if all 16 location done
Jz START yes do all again
Jmp FRED not done yet
The assembler halts at the halt after the jz BILL instruction. Dl contains F4
not AA I don’t know if an EMU8086 assembler has any protected memory
but an assembled program should only be using virtual memory so shouldn’t
actually access memory 00. Maybe I’m wrong.
Anybody got any ideas.
Regards
Scommstech