|
Forum Index : Microcontroller and PC projects : PicoMite Memory Map
| Author | Message | ||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
Hi all Is there a PicoMite (non VGA if that makes a difference) memory map available? I am attempting to teach all things "memory" and have resorted to the ZX Spectrum and Vic20 / Electron memory maps as they are relatively easy to explain / understand. Using such I can add things to memory and retrieve them with PEEK / POKE or equivalent. I have checked the manual ;-) Cheers N Entropy is not what it used to be |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8304 |
If you just want an area to peek and poke in then you can use PEEK(VARADDR var) to find the start address of a string then POKE and PEEK using that address with an offset to select the address. This has the advantage that, if you keep the POKEable area less than 250 bytes or so it's completely safe. ADDR+0 is the string length (default is 256 bytes IIRC). ADDR+1 is the first byte of the string. Note that PRINTing the string may not be reliable as not all characters from &H0 to &HFF are printable, although you can PEEK and POKE them. Edited 2022-09-20 05:25 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| Nimue Guru Joined: 06/08/2020 Location: United KingdomPosts: 425 |
Perfect - works a treat. Thank you. Is there a "map" though somewhere -- as the above require me to define a variable first. What if I just want to write/read memory at the get go? For example, in recent threads, getting the internal temperature is mentioned. Presumably somewhere in memory this exists in a raw version and the MMBasic OS just interprets / calculates something from this? So, can I pull the raw value from the Pico -- to do so needs a memory map? (Happy to be told I'm wrong about all this ;-) ) N Entropy is not what it used to be |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8304 |
This is the closest I know of. The PicoMite isn't what you might expect. The program is in flash, the variables are in RAM. Consequently you don't have large chunks of contiguous memory area to play in. Edited 2022-09-20 07:04 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2681 |
I have not needed to use peek/poke but it is in the manual. Not much about bit usage. Is it handled fast in mmbasic before I try? Using integers for bit values I can not access apart from masking using and. If one dim'd an array is there no pointer to it that could be used as a start of an "address" in ram? A blit buffer seems constant so could a blit buffer be used as ram in that it is writable and readable? Just a beginner. |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4147 |
With care, you can. Refer to the MMBasic pico sources / pico datasheet e.g. for the addresses of hardware / examples of accessing hardware (I/O registers etc). Expect some grief (CPU resets etc). John Edited 2022-09-20 08:49 by JohnS |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2832 |
@stanleyella Mixtel90 explains it clearly in post 2 of this thread. S$ = "The quick brown fox jumps over the lazy God." > ? PEEK(VARADDR S$) 537024256 > ? PEEK(byte 537024256+0) 44 > For n=1 to 44 : Print chr$(PEEK(byte 537024256+n)); : next The quick brown fox jumps over the lazy God. > ? PEEK(byte 537024256+41) 71 > ? PEEK(byte 537024256+43) 100 > POKE byte 537024256+43,71 > POKE byte 537024256+41,100 > For n=1 to 44 : ? chr$(PEEK(byte 537024256+n)); : next The quick brown fox jumps over the lazy doG. > > ? s$ The quick brown fox jumps over the lazy doG. > Byte 0 of a string is its length. In normal use it is hidden. . Edited 2022-09-20 11:15 by phil99 |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |