|
|
View previous topic :: View next topic |
Author |
Message |
.C
Joined: 06 May 2004 Posts: 19 Location: Italy
|
Reset Vector |
Posted: Thu May 27, 2004 8:45 am |
|
|
Hi
Do you know if Main() start at 0x000h ?
Thank |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
Reset vector |
Posted: Thu May 27, 2004 9:15 am |
|
|
No, main does not start at zero. If you examine the program listing you would see where everything is located.
The processor does restart at zero and, if you look at the listings you see a jump right after that around the interrupt vectors.
It might help for you to closely read the data sheet and memory map etc. |
|
|
.C
Joined: 06 May 2004 Posts: 19 Location: Italy
|
|
Posted: Thu May 27, 2004 10:17 am |
|
|
ok
What does the first two rows mean ?
Tahnks
-> * *
000000 3018 MOVLW 0x18
000001 008A MOVWF 0xa
000002 2800 GOTO 0
000003 0000 NOP
000004 00FF MOVWF 0x7f
000005 0E03 SWAPF 0x3, W
000006 0183 CLRF 0x3
000007 00A1 MOVWF 0x21
000008 080A MOVF 0xa, W
000009 00A0 MOVWF 0x20
00000A 018A CLRF 0xa
00000B 0804 MOVF 0x4, W
00000C 00A2 MOVWF 0x22 |
|
|
Ttelmah Guest
|
|
Posted: Thu May 27, 2004 10:56 am |
|
|
.C wrote: | ok
What does the first two rows mean ?
Tahnks
-> * *
000000 3018 MOVLW 0x18
000001 008A MOVWF 0xa
000002 2800 GOTO 0
000003 0000 NOP
000004 00FF MOVWF 0x7f
000005 0E03 SWAPF 0x3, W
000006 0183 CLRF 0x3
000007 00A1 MOVWF 0x21
000008 080A MOVF 0xa, W
000009 00A0 MOVWF 0x20
00000A 018A CLRF 0xa
00000B 0804 MOVF 0x4, W
00000C 00A2 MOVWF 0x22 |
Recite the following mantra fifty times:
I will state what processor I am using...
The registers used, and the exact behaviour of the chip, changes with the processor. However the 'general' answer, is that it is loading '18' into the W register, and then writing this into the PCLATH register. When you execute a 'Goto', the target address, receives it's low bits from the instruction, and it's high bits from the PCLATH register. The exact mapping changes with the chips, but for the 16 family, 11bits come from the instruction, and then the next couple of bits come from bits 3 and 4 of the PCLATH register. So the Goto, gives a jump to 0b1100000000000.
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|