Post Reply 
Speed of HP-49G Routine for Tektronix Vector Graphics Terminal
08-06-2020, 09:17 AM
Post: #20
RE: Speed of HP-49G Routine for Tektronix Vector Graphics Terminal
(08-05-2020 10:40 AM)3298 Wrote:  ...
(08-05-2020 09:45 AM)Martin Hepperle Wrote:  
Code:
  CK2&Dispatch
  REALREAL                                         ( need at least 2 Reals on the stack )
  ::
    ( translate and scale Real X, Y values )
    5PICK %-                                       ( 1:Y-Y0      2:X         3:SY 4:SX 5:Y0 6:X0 )
Ouch, you're checking for only two parameters (which have to be reals), but then you're blindly accessing stack level five. That's gonna blow up in your face when you start this program with less than five parameters, or when the upper ones aren't of the right type (looks like you want them to be reals too). A bit further down you access level six too (by the way, for that access you can use 6PICK instead of BINT6 PICK, that command does exist).
Perhaps try basic CK&Dispatch1 instead (which doesn't check for parameter presence; the CK<n> familiy only goes to five parameters, so you'll have to do it manually anyway, something like DEPTH BINT6 #<case SETSTACKERR before the CK&Dispatch1), change the REALREAL (value: 11h) to something like # 11111 so it checks all five levels it can deal with, then also add code to manually check for the type of the sixth level (perhaps 6PICK TYPEREAL? NOTcase SETTYPEERR, or alternatively for the automatic number type conversion from ZINTs a second CK&Dispatch1, like this: 6ROLL CK&Dispatch1 BINT1 :: 6UNROLL).

I'll also help you along with understanding how I made the Saturn code build the string. I should've commented it like this from the beginning... (Also, sorry about the weird characters that might show up in the longer comment lines, the forum is responsible for that and I can't remove them.)
...

Thank you for commenting the assembler code - I had started to decrypt it but now it becomes much easier for me. All this nibble twisting is still confusing me.

I had not seen that 6PICK exists - I only found 5PICK in my documents.

You are right concerning the type check for the stack parameters - I will see how foolproof this routine should be. Maybe I simply stop at the test for 5 REALs with 11111b to not slow down the code too much. Maybe I'll add the simple DEPTH check to make it clear that 6 parameters are needed.

Concerning the scaling to 12 bits I will leave it as it is - maybe one day I can run it on a real Tektronix display with the high resolution enhancements.

I also managed to use the EQ list from the Plot application so that I now iterate over all functions set up in the Plot Application without becoming too sluggish.

Martin
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Speed of HP-49G Routine for Tektronix Vector Graphics Terminal - Martin Hepperle - 08-06-2020 09:17 AM



User(s) browsing this thread: 1 Guest(s)