Hi,
When the pic starts all the RAM is empty.
One of the first lines of your code is the Include statement - see code below.
This is the complete list of the Pics own system registers that it loads into those dedicated RAM locations, typically the high bytes on the 18F chips.
Everything else below them is still empty.
To run your program your need work files / user registers.
You can address the RAM directly by is location like movwf 0x101 and movwf 0x504, very confusing .
So you assign a label / name in Assembly to the RAM locations, the Assembler then converts your labels into the direct addresses to go into your completed code.
Like the system registers, you have to load in your Users registers, this is done by a couple of methods, but I prefer the Cblock directives, again see the code example.
Its up to you to enter these labels and keep track of them.
In the disassembly listing what you are seeing is the Program Memory, the actual program code instructions, this a memory area called PROM and is totally separate from the RAM data memory ( and also EEprom)
Do not worry about asking the seemingly obvious, apart from a few Einsteins, we have all been there
What chip are you using, it looks like a large one with all that ram, the big ones can be quiet complex to set up.
Code:
; Processor Type
; ==============
LIST P=18F4520,r=hex,n=80,x=off,st=off
errorlevel -302 ; no bank warnings
#include <P18F4520.INC>
;******************************************************************************
;
; Configuration bits
; ==================
; specified here are changes to the .inc file defaults
CONFIG OSC=INTIO67, PWRT=ON, BOREN=OFF, WDT=OFF, LPT1OSC=OFF, PBADEN=OFF, MCLRE=ON ; MCLRE ON !!!!
CONFIG LVP=OFF, XINST=OFF, DEBUG=OFF
; Bank0 variables 0x000 to 0x07F access ram
cblock 0x000
crash1
crash2
ENDC
; Bank1 variables 0x100 to 0x1FF
cblock 0x100 ; BANK1
crash3
crash4
endc
cblock 0x200 ; BANK2 etc,etc
crash5
crash6
endc
;******************************************************************************
;
; Reset vector
; ============
ORG 0x0000
bootup goto Main ;go to start of main code
; ******************************
;
; Start of main program
; =====================
Main movlw b'01100010' ; set internal osc to 4 mhz
movwf OSCCON
; BANK1 specifed
movlw 0X7F
movwf crash1 ; in access ram bank 0
movlw 0xF7
movwf crash1
movff crash1,crash2
goto main