PDA

View Full Version : Has anyone used writecode with 18F ??



Marten
- 1st March 2005, 09:31
Please help me a little.
Many people seem to read my messages, but no comments ?
Melanie, anyone, heeelp .. :=)

I dont know how to write 8 bytes in a block with writecode :(
i'm perhaps stupid, but i'm not getting any smarter without some help either, give me a hint atleast ..

Marten

Marten
- 2nd March 2005, 22:18
this actually works:

This code snippet copies a bunch of bytes to a different location in codespace.

simple, when you know...

'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@

I var byte ' Loop count
D var word ' Data
A var word ' Address
Y var word
x var byte

Y=$0000 'Location to copy data from
A=$04F0 ' Location to copy data to

main
For x = 0 to 9
Lcdout $fe,1,"Copying Data ! "
For I = 0 To 14 ' Loop 14 times
Readcode Y,D ' Read Data and copy it to new location
Writecode A,D ' Send value in D to code space location A
A = A + 1 ' Increment Address
y = Y + 1
pause 10
Next I
Pause 1
Next x

goto showme

showme:

A= $04F0

For I = 0 To 72 ' Loop 72 times
Readcode A,D ' Get data in location A
Lcdout $fe,1,"Data:",hex A,":",hex D ' Display the location and data
Pause 1000
A = A + 1 ' Increment Address
Next

End

goto main