HP Forums

Full Version: MCODE - good entry point for RCLPTA or similar to find a file in X-Memory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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

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.

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.

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

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

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

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