ahmad
Member level 1
programming in pic in basic language
Hi there,
Please give me an idea to solved my problem.
I 'm using 16F84A
I create 1 variable as a memory address pointer named as pointer and i want the pic microcontroller to write a data to the address mention inside the variable address. example my data is 5 and address inside the variable pointer is 20h.
Pointer equ 10h
data equ 11h
start
movlw 0x05
movwf data ; save 5 to data variable
movlw 0x20
movwf pointer ; save 20 to variable pointer
; i want it to save the data (5) inside address 20h which is pointed by variable pointer.but fail
movf data,w
movwf pointer ; failed because it will write data 5 to memory 10h
incf pointer ; point for another memory
Hi there,
Please give me an idea to solved my problem.
I 'm using 16F84A
I create 1 variable as a memory address pointer named as pointer and i want the pic microcontroller to write a data to the address mention inside the variable address. example my data is 5 and address inside the variable pointer is 20h.
Pointer equ 10h
data equ 11h
start
movlw 0x05
movwf data ; save 5 to data variable
movlw 0x20
movwf pointer ; save 20 to variable pointer
; i want it to save the data (5) inside address 20h which is pointed by variable pointer.but fail
movf data,w
movwf pointer ; failed because it will write data 5 to memory 10h
incf pointer ; point for another memory