??? 05/28/06 09:04 Modified: 05/28/06 09:14 Read: times |
#117195 - Example Code Responding to: ???'s previous message |
Here's a fragment from a DS89C420 program that I wrote awhile back that used the internal 1kB SRAM:
PMR equ 0C4h ;power management register . . . orl PMR,#00000001b ;internal 1kB sram enabled as data memory, DMEO (PMR.7) = 1 . . . movx A,@DPTR ;read from SRAM (indexed by DPTR, range = 0000h - 03FFh) . . . movx @DPTR,A ;write to SRAM You can also set the SRAM as a merged program/data memory by setting the PRAME bit in the ROMSIZE sfr. I don't recommend doing so, as running self-modifying code is playing with fire unless you are very, very careful. |