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: Suggestion to replace Peek(ProgMem, of) and Peek(VarTbl, of)
Author | Message | ||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 3830 |
Hi Peter, I recognise that PEEK(ProgMem, offset) and PEEK(VarTbl, offset) only have very specialised use-cases but even within those I'm not sure these are the optimal functions to have in the language because they force the user to read a byte at a time. Should you consider replacing them with PEEK(ProgMemAddr) and PEEK(VarTblAddr) ? That way MEMORY COPY and MEMORY SET can be used with these data structures, and also PEEK(SHORT|WORD|INTEGER) ... though the user has to be careful to avoid data alignment errors ... ... or is this deliberate to prevent the use poking into these areas ... in which case why is there a POKE(VarTbl ...) ? Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8566 |
In both cases there are reasons you may wish to read a byte that isn't word aligned so I don't intend to change this. You can do something completely different in the Linux port as this is of minority interest |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 3830 |
Thanks Peter, My suggestion wouldn't preclude that, e.g. Peek(Byte Peek(VarTblAddr) + offset) though you could argue for: Peek(Byte Mm.Info(VarTblAddr) + offset) Fair enough, I probably won't as I don't envision much call for extensions beyond the capabilities of the CMM2 and PicoMite that aren't specifically related to interacting with a "real" operating-system. Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Print this page |