41CL Routine of the week: "YEDIT"



#4

Not meaning to set a forced commitment but it'd be neat idea to share your favorite CL routine w/ the rest of the folks, no matter how simple it is, FOCAL, MCODE, all goes :-)

Preaching with the example, here's a short one that makes vieving the contects of RAM and FLASH a very easy affair.

Often I need to check for the right content of a given block, since I'm always moving stuff in RAM - and lately also in FLASH as I'm adding more modules and new versions of existing ones to the library. Using YPEEK is of course the way, but it's a bit tedious to remember the format and proper syntax so a little driver routine was in order.

Here it is, make sure you have the CLUTILS and the AMCOSX plugged (or the CCDOSX, or the original CCD for that matter). The only requirement is to make YINPT programmable - which it isn't in the posted versions. For that just change the first word in the MCODE from its current value 000 (NOP) to 260 (SETHEX), a good neutral byte.

01*	LBL "YEDIT"
02 YINPT
03 ASTO X
04 12
05 WSIZE
06 CLX
07 LBL 05
08 CLA
09 ARCL Y
10 ARCLH
11 "|- -8888"
12 YPEEK
13 PROMPT
14 E
15 +
16 GTO 05
17 END

To use it, input the first three digits of the (HEX) address (a.k.a. block) at the "Y: _" prompt and hit R/S. All bytes values will be shown with each consecutive R/S action, increasing automatically.

To jump to another location within the same block, just input the offset from the current one in X (in decimal of course), press "+" to advance or "-" to back up, and resume with R/S to get there.

YEDIT is just a minimalistic routine to review the values, but will be easy to enhance it to also modify them using YPOKE, getting closer to a real editor. Anyone going for that?

Hope you enjoy it.

Note: if changing the NOP to HEXEDIT is not for you, just program the function using the XROM XX,NN while the CLUTILS is *not* plugged, then plug it before running it.


Edited: 16 May 2012, 7:44 a.m. after one or more responses were posted


#5

Is not YEDIT some sort of snow monster living in the high Himalayas???


#6

Well, yes if you're (like me) a bit dyslexic :-)

Edited: 16 May 2012, 1:51 p.m. after one or more responses were posted


#7

Darn! You beat me to it!

LOL

Cheers,

-Marwan

#8

ok, ok, by popular demand here´s a possible extension that also writes to RAM using YPOKE. Note that it´s also quite compact, but its usability is somehow limited: it obviously won't write to FLASH.

Also for RAM blocks mapped to the MMU (of course) you may rather use a proper HEX Editor, like HEXEDIT in the HEPAX or ROMED in the ToolBox4.

Anyway, FWIW here it is - the extended version now so you can pick your choice.

01*	LBL "YEDIT+"
02 YINPT
03 ASTO X
04 12
05 WSIZE
06 CLX
07 LBL 05
08 CLA
09 ARCL Y
10 ARCLH
11 "|- -8888"
12 YPEEK
13 AVIEW
14 Y/N?
15 X<0?
16 GTO 02
17 E
18 +
19 GTO 05
20 LBL 02
21 YCL-
22 APPEND
23 YPOKE
24 GTO 05
25 END

Y/N? in line #14 is in the CLUTLS4H module. It expects a Yay/Nay response, it'll continue showing the next address if "Y" (or R/S), or will prompt for the new byte value if "N".

APPEND in line #22 is on the TBOX4 module as well. It's a nice alternative to PMTA that doesn't delete the "prompted" text. It'll be also possible to use YINPT there instead to remove the dependency.

It's a poor-man's version of an Editor but illustrates the point.

Cheers,
'AM

Edited: 17 May 2012, 4:54 a.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP-41CL setup troubleshooting Xavier A. (Brazil) 2 1,909 12-02-2013, 06:29 AM
Last Post: Xavier A. (Brazil)
  [41CL] New Extra Functions version Monte Dalrymple 0 1,130 11-08-2013, 04:32 PM
Last Post: Monte Dalrymple
  So, latest 41CL / Library 4 config is... Gene Wright 4 2,046 09-22-2013, 02:59 AM
Last Post: Ángel Martin
  Flash Flood Warning: 9/16/2013 (One Week from HHC13) Eddie W. Shore 8 2,927 09-17-2013, 09:20 PM
Last Post: Craig Ruff
  HHC 2013: One Week To Go Eddie W. Shore 2 1,525 09-13-2013, 05:32 PM
Last Post: Craig Ruff
  WP-34S Matrix operations with routine-local registers? Tom Grydeland 1 1,214 09-04-2013, 10:46 AM
Last Post: Marcus von Cube, Germany
  HP-41CL anyone? Matt Agajanian 8 2,977 08-31-2013, 12:27 AM
Last Post: Sylvain Cote
  [41CL] A couple more rhetorical questions Monte Dalrymple 1 1,277 07-12-2013, 09:28 AM
Last Post: Ángel Martin
  41CL :TROUBLE IN FILE TRANsFER aurelio 22 6,276 06-18-2013, 03:44 PM
Last Post: aurelio
  Auction Scam of the Week? Frido Bohn 4 2,041 06-03-2013, 01:45 PM
Last Post: Mike Morrow

Forum Jump: