41-MCODE trivia: backwards or forwards?



#5

As informed MCODERS you guys out there know the second digit of a FAT entry can be used to signal the location of the function code, relative to the page the FAT is in.

So a FAT entry like 00A0BC indicates: current page, address 0xpABC

whereas a FAT entry like 01A0BC is for the *next* page, and BTW "subsequent" ones can be also called by increasing the page digit, like: 0x02ABC, and 0x03ABC....

Put this together with the fact that an entry like 0x0FA0BC denotes the *previous* one, and that "decreasing" the digit will also reach out to preceeding pages, like two earlier (E), three (D), etc.

But is there a limit to this scheme, and where is it?
For instance, the most confusing one: does 0x08ABC denote 8 pages behind or 8 pages ahead?

What's your guess? :-)


#6

That it wraps around and thus makes no difference?

#7

I do not believe that we add or substract the page. I prefer to say that we always add and perform a "AND 0xF" to the page result.

And this true is we go forward 13 + 1 = 14 & 15 = 14
And backward 13 + 15 = 28 & 15 = 12.

Trying with nsimII. Putting a value of 0x08a0bc jumps 8 pages.
I put a module in page 13 (D) and the code in page 5 (13-8).

CAT 2 shows the function in page 5.
XEQ "..." calls the function in page 5.

And this is also 13 + 8 = 21 % 16 = 21 AND 15 = 5.
Putting 08a0bc in page 5 will jumps also 8 pages to go in page 13.

CAT 2 shows the function in page 13.
XEQ "..." calls the function in page 13.

Edited: 5 Mar 2012, 2:22 p.m.

#8

It always add and truncates the resulting address to 16 bits.

Truncating away a 1 means that it wraps around to a page below. Truncating away a 0 means that we go to a higher page (no wrap).


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP-41 MCODE: The Last Function - at last! Ángel Martin 0 169 11-08-2013, 05:11 AM
Last Post: Ángel Martin
  41-MCODE: Auto XEQ+ALPHA possible? Ángel Martin 5 317 05-29-2013, 06:15 AM
Last Post: Ángel Martin
  HP 41 Mcode related Questions Michael Fehlhammer 4 271 05-10-2013, 07:09 PM
Last Post: Michael Fehlhammer
  HP-41C Trivia Question Dan Grelinger 12 487 03-12-2013, 09:57 AM
Last Post: Dan Grelinger
  [Clonix/NOV] NoV-64 backwards compatibility Doug (NYC) 0 161 01-20-2013, 11:21 AM
Last Post: Doug (NYC)
  41-MCODE: Breaking the FAT barrier. Ángel Martin 0 134 09-03-2012, 06:31 AM
Last Post: Ángel Martin
  41-MCODE: Dr. Jekyll & Mr. Hyde Ángel Martin 9 406 07-09-2012, 09:41 AM
Last Post: Monte Dalrymple
  HP41C: Factorial (kind of) in MCODE Frido Bohn 7 379 05-26-2012, 09:18 AM
Last Post: Frido Bohn
  41-MCODE: SOLVE & INTEG - 4k ROM Ángel Martin 9 403 04-19-2012, 05:29 AM
Last Post: fhub
  41-MCODE: a weekend challenge Ángel Martin 3 203 03-19-2012, 06:49 AM
Last Post: Mike (Stgt)

Forum Jump: