MCODE programming: help needed with asmnut 0.40.1
|
01-26-2021, 12:13 PM
(This post was last modified: 01-26-2021 12:41 PM by hmilz.)
Post: #1
|
|||
|
|||
MCODE programming: help needed with asmnut 0.40.1
Hi all,
I'm trying to get my head around building some new functions and began playing with asmnut. I have a question concerning the PROMPT feature that asmnut nicely supports. Sadly, the way PROMPT works (and doesn't work) is not as documented in DOCUMENTATION, and it is contradictory in prompt.c. DOCUMENTATION says, Code:
and the code in prompt.c looks like this Code:
where the left part coincides with the documentation above, and the right hand part (after //) coincides with what Meindert Kuipers wrote here. Anyway. The flags A, a, or 2SIY appear to work and do what they are supposed to, but all others I've tried throw an assembler error, e.g. PROMPT 2 gives: Code:
Also, the bits actually created by the assembler do coincide with Meindert's part but not with what the flags are supposed to do according to DOCUMENTATION. I am confused. Is there a newer, bugfixed version of asmnut anywhere? It looks as if asmnut was hosted in git at an earlier point in time but I could not find anything anywhere. PS Is Christophe still around? Thank you! Regards, Harald |
|||
01-26-2021, 03:55 PM
Post: #2
|
|||
|
|||
RE: MCODE programming: help needed with asmnut 0.40.1
OK, I think I sort of fixed the PROMPT function, by simply mapping all the mainframe supported prompt variants. In prompt.c, I set:
Code:
and in the for loops in make_prompt(), I limited i to 13 for the 13 entries. The mask is now no longer needed so one might to throw this out too. @Christophe, you will probably have had something in mind with the way you set this up but it did not work for me, and I could not understand what you were trying to achieve. At the end of the day, as I understand the mainframe function, it supports only the 12 combinations pointed to by the bits in the left column. Now if there is a git repo somewhere ... |
|||
01-26-2021, 07:53 PM
Post: #3
|
|||
|
|||
RE: MCODE programming: help needed with asmnut 0.40.1
Hello Harald,
Yes It seems that comments are not aligned with the code. Sorry. Could you please share the PROMPT you want to set in function header. I am not sure I have tested all solutions. I did no change in the new version, so perhaps I never discovered this issue. Thanks for reporting it. Regards, Christophe |
|||
01-27-2021, 11:58 AM
Post: #4
|
|||
|
|||
RE: MCODE programming: help needed with asmnut 0.40.1
Hi Christophe,
(01-26-2021 07:53 PM)cgh Wrote: Could you please share the PROMPT you want to set in function header. I am not sure I have tested all solutions. As outlined in the code snippet above, when I now write Code:
what I get is bits set to 0x33, i.e. "2 Digits, IND, IND ST, non-null Alpha . or ..". This is a 1:1 mapping from Meindert's list mentioned in an earlier post in this thread. A combination of Flags seems not possible because the 2x 2 extra bits is all the mainframe can work with as far as I understand. |
|||
01-27-2021, 03:07 PM
Post: #5
|
|||
|
|||
RE: MCODE programming: help needed with asmnut 0.40.1
I think it is important to let us know what you are trying to achieve. I also read that the assembled code has the bits correct, how did you confirm that?
If the bits are assembled correctly (verify with the hex editor on your HP41) then make certain that the function is non-programable (NOP after the function name). These prompting functions can be very tricky. Regards, Meindert |
|||
01-27-2021, 04:19 PM
Post: #6
|
|||
|
|||
RE: MCODE programming: help needed with asmnut 0.40.1
Hi Meindert,
(01-27-2021 03:07 PM)MeindertKuipers Wrote: I think it is important to let us know what you are trying to achieve. I also read that the assembled code has the bits correct, how did you confirm that? With the code in place I showed above, the bits that are set are exactly as listed by you in this post. Verified by the assembler listing produced by asmnut, and I tested all functions within Nonpareil. (I have no physical HP-41 right now but NP uses the original HP-41 ROMs anyway.) (01-27-2021 03:07 PM)MeindertKuipers Wrote: If the bits are assembled correctly (verify with the hex editor on your HP41) then make certain that the function is non-programable (NOP after the function name). These prompting functions can be very tricky. "PROMPT C" was just an example. I any case I don't want to break anything. I started by using the original asmnut code and found that only very few prompts worked as documented, which points either to an error in the code or the documentation. I still don't understand what the original code tried to achieve by accumulating bits in the mask. Isn't it true that the mainframe only interprets these 12 variants? Methinks that my suggested code is far simpler and straightforward. But I'm all open to an explanation. |
|||
01-27-2021, 08:59 PM
(This post was last modified: 01-27-2021 09:09 PM by cgh.)
Post: #7
|
|||
|
|||
RE: MCODE programming: help needed with asmnut 0.40.1
(01-27-2021 11:58 AM)hmilz Wrote:Hi, Sorry but I dont't understand. What is the PROMPT do you expect to create ? How many digits ? ALPHA ? IND ? ... By the way, PROMPT C is not possible in asmnut. You must set a combination of 1 2 F 3 S I Y +. a and/or A, For example, if you want a PROMPT of 3 digits, use Code: .NAME "3DIG" PROMPT 3 I you want a prompt of 2 digits limited to 0-55 and enable the IND, use: Code: .NAME "55IND" PROMPT FI and so on... What PROMPT do you want to set ? The documentation is right. Don't look to the code, the comments may be outdated. This is the PROMPT I have in some functions: Code: .NAME "LA" PROMPT 3 Regards, Christophe |
|||
01-29-2021, 08:44 AM
Post: #8
|
|||
|
|||
RE: MCODE programming: help needed with asmnut 0.40.1
Hi Christophe, thanks for jumping in. Let me try to explain where the confusion comes from. First of all, I don't need any help or support with prompting per se. I just wanted to understand how asmnut supports the 12 HP supported available prompts because I failed to understand the combination of DOCUMENTATION and the code in prompt.c. When analyzing your code, I found that I might as well support the 12 available prompts in a straightforward manner, and applied my local changes as shown in #2 above.
Nevermind. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)