1
\$\begingroup\$

I am testing a basic timer example in keil (8051 ) when I debug this code

org 0
MOV TH0,#76
MOV TL0,#01
MOV TMOD,#01
SETB TR0
JNB TF0,$
end

I get the error

 error 65 access violation at c: 0x000e no execute read permission

Please I need help to solve this problem

Trevor_G
47.3k8 gold badges74 silver badges160 bronze badges
asked Aug 31, 2017 at 20:38
\$\endgroup\$
0

2 Answers 2

1
\$\begingroup\$

You have a classical mistake here. You have made no provisions as to what your program should be executing after you get to address 0x000E.

Here take a look:

C:0x0000 758C4C MOV TH0(0x8C),#0x4C
C:0x0003 758A01 MOV TL0(0x8A),#0x01
C:0x0006 758901 MOV TMOD(0x89),#0x01
C:0x0009 D28C SETB TR0(0x88.4)
C:0x000B 308DFD JNB TF0(0x88.5),C:000B
C:0x000E ???? ??? ??? ???

Just because you put an "end" statement in your assembly language source code means nothing to the run time 8051 core trying to fetch instructions.

answered Aug 31, 2017 at 21:59
\$\endgroup\$
0
\$\begingroup\$

Debug->Memory Map, make sure that the memory map is properly enabled for read/write (say 0x0000 to 0xFFFF)

answered Aug 31, 2017 at 20:44
\$\endgroup\$
1
  • \$\begingroup\$ See Michael's answer for why the debug map does not cover your uninitialized memory. An accurate debugging session would follow the CPU as it merrily executes whatever (possibly random or 0xFF bytes) is in the program memory following your program fragment. 0xFF is MOV R7,A. \$\endgroup\$ Commented Sep 1, 2017 at 4:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.