Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:50 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: MemEdit Memory Editor

Author Message
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 10:39am 06 Oct 2020
Copy link to clipboard 
Print this post

Hi all,

As said, here is MemEdit, derived from HexEdit.

https://github.com/epsilon537/memedit_cmm



Description
-----------
MemEdit presents you with a view into CMM2's (virtual) memory and allows you to make changes. Essentially, it's a peek/poke front-end. This means that the tool is limited to the virtual address space exposed by peek and poke.  

The memory contents are shown as hexadecimal byte values and as ASCII code in two side-by-side blocks. Changes can be made both in the hex table section and in the ASCII section.

The usual file navigation with cursors keys, page up&down, home, end, etc. should work as expected.

MemEdit is a full-screen console-only editor. I does not work over serial, sorry.

The starting address to view can be passed in as a command line argument, e.g. *memedit MM.INFO(PROGRAM)

Commands such as goto and fill accept MMBasic syntax for address specifications, e.g. Go To Address (MMBasic syntax): MM.INFO(PAGE ADDRESS 0)

Press F1 to get help on key bindings.

Current limitations
-------------------
Console only.

Cheers,
Epsilon.
Epsilon CMM2 projects
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 12:47pm 06 Oct 2020
Copy link to clipboard 
Print this post

I made this tool because I said I would, because it was easy after hexedit, and because some people expressed an interest. However, the usefulness of this tool is not obvious to me currently. Poking around on page 0 gets old after a while ;-)
On a C64, which doesn't have a virtual memory concept, such a tool is very useful. It gives you a unfiltered view on the entire address space, including the I/O address space.
Here, we are limited to what peek and poke will let you see. Maybe, with a clever CSUB, it's possible to tunnel through to the physical address space underneath. I haven't looked at the M7's memory management yet, so I don't know. If I figure it out I might add the capability.
Epsilon CMM2 projects
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:07pm 06 Oct 2020
Copy link to clipboard 
Print this post

Peek and poke only restrict to the extent that the addresses are real so you don't get a bus error.  They also block access to the C variables and stack to avoid the worst mistakes.

DTCMRAM (rw)    : ORIGIN = 0x20000000, LENGTH = 128K
AXIRAM (rw)     : ORIGIN = 0x24000000, LENGTH = 512K
RAM_D2 (rw)     : ORIGIN = 0x30000000, LENGTH = 288K
RAM_D3 (rw)     : ORIGIN = 0x38000000, LENGTH = 64K
ITCMRAM (xrw)   : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 1024K
FLASH2 (r)      : ORIGIN = 0x08100000, LENGTH = 1024K
RAM_D5 (rw)     : ORIGIN = 0x38800000, LENGTH = 4K


#define RAMBASE         0x30000000
#define RAMEND           0x30040000-0x100
#define SRAMBASE         0x38000000
#define SRAMEND         0x38010000-0x100
#define RAM(a)  ((a >= RAMBASE && a < RAMEND) || (a >= SRAMBASE && a < SRAMEND) || (a >= 0x24000000 && a < 0x24080000) || (a >= 0x40000000 && a < 0x59000000) )
#define ROM(a)  ((a >= 0x08000000 && a < 0x08200000) || (a >= 0x10000000 && a < 0x20000000))
#define PEEKRANGE(a) (RAM(a) || ROM(a))
#define POKERANGE(a) (RAM(a))

Edited 2020-10-06 23:13 by matherp
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 09:55am 08 Oct 2020
Copy link to clipboard 
Print this post

That's useful info. Thank you! I defined constants for these address ranges so they can be used in address specifications. The constant names and their values are shown in the help screen.

https://github.com/epsilon537/memedit_cmm
Epsilon CMM2 projects
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025