MCODE - good entry point for RCLPTA or similar to find a file in X-Memory



#2

Hi, one more quest to the MCODE gurus out there (related to my other post)

If I know the name of a file in X-Memory, is there a good entry point I can use to get its starting address? (without disturbing Alpha and the stack if possible)

Basically, I'm looking for the routine that must be used in all the SEEKPTA, RCLPTA, etc functions which take the file from the Alpha register and then first find it to make it the working file and then do some other stuff.

I only need the part which finds the file and gives me the address of the first register. Ideally I can have the name loaded into C or B or whatever, so that I don't have to write it into Alpha, deleting it in the process etc...

[with regards to my other post - I then could have my ConInit function create a very special file in X-Memory (e.g. with a file name that can not be typed, say FF-C-O-N-S-T-FF) and the requisite absolute address (and any other info I need) in the next reg(s))]

But this requires to find a file in X-Memory and I don't want to have to write this myself (moving from pointer to header register file by file, etc) as the OS must have this in a much better form I could ever come up with.

Unfortunately I don't know any literature that writes about the VASM from the X/F module and where such a routine might be found.

But my hope is that some of you might know and can help me out...

Cheers

Peter


#3

It's trickier than that. Just because a file starts at a particular address b doesn't mean that its nth word is at b+n, because a file can be split across a module boundary. Unless you want to deal with the module and file headers yourself, you'll have to call code in the EM module to locate each register you want to access.

I haven't studied the Extended Functions VASM listing in depth, so I'm not sure that there are any entry points useful for this, or that such entry points are at the same addresses in the various revs of the module and the 41CX built-in functions.


#4

There are many useful routines in the Extended Functions module, but since there are more than one revision of the module and the CX has it elsewhere, they move around.

The safest way is to copy the relevant code to your own module.


#5

Yes, that module boundary problem is tricky. I thought though that I could maybe use the first register to store that info. basically making the address part of the file name so that I don't have to move forward and potentially cross boundaries.

Cheers

Peter

#6

Hakan, Eric,

Thanks so much for your kind posts.

Does either one of you have a electronic list of the entry-points for the X/F code? Or any notes/articles about it? Is there anything written in the any PPC Journal about the MCODE of the X/F that you know about?

You say they move around, which means I have to copy all dependencies as well... hmm, not that convenient either...

Cheers

Peter


#7

Peter,

The XFUN VASM listing are on the TOS DVD and on the hpmuseum DVD set, I just checked. Unfortunately I know of no electronic version. I once tried to OCR a few pages of the VASM listing but the software I used didn't really handle the column format very well.

If you can type in (or OCR) just the list of labels (the cross reference at the end of the VASM listing) then the list can be added to the label file in the MLDL2000 handler, and a readable disassembly could be produced.

Meindert


#8

Done. You have mail Meindert (I will also post it here once I have a tad more space to post the files)

I have typed in (tried OCR as well but no chance whatsoever...) the complete reference list of all three 4k blocks of the X/F module (marked as 'Symbol List') as well as the more general Entry Points (marked as Entry Points) which are a subset of the Symbol List.

The addresses are in Oct, Dec and Hex.

Now, how can we use this to generate an electronic listing via the MLDL2000 handler? Or could you possibly be persuaded to generate that listing, given that you are most familiar with the MLD2000 Handler?

Thanks so much for your kind help. Maybe the label listing is useful for others as well...

Cheers

Peter


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime: adding an entry to a vector Alberto Candel 12 1,450 12-02-2013, 01:18 PM
Last Post: Alberto Candel
  HP PRIME: derivative at a point Alasdair McAndrew 2 436 11-19-2013, 06:52 AM
Last Post: parisse
  Complex Number Entry on Prime Jeff O. 19 1,959 11-16-2013, 12:34 PM
Last Post: Jeff O.
  HP-41 MCODE: The Last Function - at last! Ángel Martin 0 357 11-08-2013, 05:11 AM
Last Post: Ángel Martin
  Cannot delete file Les Koller 4 684 11-07-2013, 12:17 AM
Last Post: Les Koller
  File Format: hpprgm Thomas Chrapkiewicz 6 976 10-30-2013, 09:32 PM
Last Post: Thomas Chrapkiewicz
  Program to change entry mode on Prime Michael de Estrada 3 585 10-28-2013, 10:13 AM
Last Post: Han
  Does RPN entry mode cause the Prime keyboard to lock up ? Michael de Estrada 14 1,464 10-22-2013, 06:27 PM
Last Post: John Colvin
  Prime cant find Memory available Dougggg 5 686 10-07-2013, 07:24 PM
Last Post: Han
  HP-Prime File extension Paul D. Fox 6 740 10-07-2013, 01:45 AM
Last Post: cyrille de Brébisson

Forum Jump: