Speed of HP-49G Routine for Tektronix Vector Graphics Terminal
|
08-03-2020, 08:34 AM
(This post was last modified: 08-03-2020 08:39 AM by Martin Hepperle.)
Post: #1
|
|||
|
|||
Speed of HP-49G Routine for Tektronix Vector Graphics Terminal
I wrote a small HP-49G RPL program to test a Tektronix vector graphics terminal emulator (which I would normally use with a CP/M or MS-DOS system) – but why not with a graphing calculator?
The Tektronix terminals expect each pair 12-bit integer x-y- coordinates [0…4095] in a specific format as a sequence of 5 printable characters with the following bit patterns: Input Code:
Code:
I wrote several version of the conversion subroutine
Variant 3 and 4 were slowest and made no difference in speed. Version 2 using the stack was slightly faster than version 1 with the local variables. So currently version 2 is my favorite. Do you see more options to speed up the code without reverting to SysRPL or other heavy tricks? On entry to my routine TEKXY the X and Y coordinates are on the stack. In my example the ranges are X=[0…400], Y=[0…2]. Therefore Y is scaled by 1500 and X by 10 to map approximately to the 12 bit range [0…4095]. The output of the routine is a 5 character string. Example: Code: 2: 123 note: X Code of variant 2 (line breaks added to show scaling, composition of the bytes 1…5 and, final cleanup). The first scaling step leaves X and Y swapped on the stack so that the PICKs use this stack layout: Code: 1: Y Code: 'TEKXY' |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)