Skip to content

Commit

Permalink
Rename product to Ladybug
Browse files Browse the repository at this point in the history
It is quite a bit lighter, the previous name was just too long.

Also rearranged keyboard slightly so that ASR end up on the middle
shifted-C key, feels more natural.
  • Loading branch information
hth313 committed Sep 22, 2016
1 parent 8abd644 commit 92306dc
Show file tree
Hide file tree
Showing 18 changed files with 261 additions and 95 deletions.
8 changes: 4 additions & 4 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/programmer.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ladybug.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/programmer.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ladybug.qhc"

applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
Expand All @@ -104,8 +104,8 @@ devhelp:
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/programmer"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/programmer"
@echo "# mkdir -p $$HOME/.local/share/devhelp/ladybug"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ladybug"
@echo "# devhelp"

epub:
Expand Down
Binary file modified doc/calculator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/calculator.xcf
Binary file not shown.
18 changes: 9 additions & 9 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# programmer documentation build configuration file, created by
# ladybug documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 10 20:45:33 2016.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -49,7 +49,7 @@
master_doc = 'index'

# General information about the project.
project = u'programmer'
project = u'Ladybug'
copyright = u'2016, hth313'
author = u'hth313'

Expand All @@ -58,9 +58,9 @@
# built documents.
#
# The short X.Y version.
version = 'P001'
version = '0A'
# The full version, including alpha/beta/rc tags.
release = 'P001'
release = '0A'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -203,7 +203,7 @@
#html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'programmerdoc'
htmlhelp_basename = 'ladybugdoc'

# -- Options for LaTeX output ---------------------------------------------

Expand All @@ -225,7 +225,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'programmer.tex', u'programmer Documentation',
(master_doc, 'ladybug.tex', u'Ladybug Documentation',
u'hth313', 'manual'),
]

Expand Down Expand Up @@ -255,7 +255,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'programmer', u'programmer Documentation',
(master_doc, 'ladybug', u'Ladybug Documentation',
[author], 1)
]

Expand All @@ -269,8 +269,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'programmer', u'programmer Documentation',
author, 'programmer', 'One line description of project.',
(master_doc, 'ladybug', u'Ladybug Documentation',
author, 'ladybug', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
30 changes: 15 additions & 15 deletions doc/differences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Differences to the HP-16C
*************************

Being inspired by the HP-16C there are a lot of similarities between the Programmer's module for the HP-41 and the HP-16C. Apart from the obvious differences, such as form factor, battery life, alpha capabilities on the HP-41 and dedicated decorated keyboard on the HP-16C, there are a lot more subtle differences, which are discussed in this chapter.
Being inspired by the HP-16C there are a lot of similarities between the Ladybug module for the HP-41 and the HP-16C. Apart from the obvious differences, such as form factor, battery life, alpha capabilities on the HP-41 and dedicated decorated keyboard on the HP-16C, there are a lot more subtle differences, which are discussed in this chapter.



Expand All @@ -21,7 +21,7 @@ The sign and zero flags are very common on micro processors and gives additional
Compares
========

Compares on the HP-16C is done using traditional HP calculator operations, by providing a set of operations that compares between X and Y, and X to 0. The Programmer works more like a micro processor. It provides a ``CMP`` instruction that compares X to any register value and set flags accordingly. After ``CMP`` you can interpret the result using a flag test operation ``FC?``, ``FS?`` or some of the built in relation test instruction like ``LT?`` and friends.
Compares on the HP-16C is done using traditional HP calculator operations, by providing a set of operations that compares between X and Y, and X to 0. Ladybug works more like a micro processor. It provides a ``CMP`` instruction that compares X to any register value and set flags accordingly. After ``CMP`` you can interpret the result using a flag test operation ``FC?``, ``FS?`` or some of the built in relation test instruction like ``LT?`` and friends.
It is also possible to use the ``TST`` instruction, or rely on the flags set after doing an operation.

.. note::
Expand All @@ -41,31 +41,31 @@ As a result, the mode separation is not as strict and stack register values are
Word size change affecting stack
================================

The HP-16C truncates values on the stack according to the active word size. Changing a word size to a smaller one and then back will not preserve all value bits. The Programmer preserves value bits on the stack.
The HP-16C truncates values on the stack according to the active word size. Changing a word size to a smaller one and then back will not preserve all value bits. Ladybug preserves value bits on the stack.

Increasing the word size in signed mode will cause a sign extension of all registers on the stack in the Programmer. The HP-16C does not perform sign extensions.
Increasing the word size in signed mode will cause a sign extension of all registers on the stack with Ladybug. The HP-16C does not perform sign extensions.

Sign extending the stack is the only time when the Programmer go around and alter all the values on the stack. This is because sign extending tends to be a natural thing to do, as it preserves the numeric value.
Sign extending the stack is the only time when Ladybug goes around and alter all the values on the stack. This is because sign extending tends to be a natural thing to do, as it preserves the numeric value.

The reason that it is not always done, is that the HP-41 at any time can perform floating point operations, and keeping the stack properly masked would be a quite elaborate task that would get in the way with the ability to keep floating point values around. The HP-16C has an easier task here, as it has a more strict separation between floating point mode and integer mode.

The Programmer's module will mask numbers when they are used as input to operations, not because they are laying around somewhere.
In Ladybug, numbers are masked as needed when they are used as input to operations, not because they are laying around somewhere.


.. index:: postfix operands, operands

Postfix operands
================

The Programmer takes advantage of the prompting functions on the HP-41 to allow for accessing stack registers in the same ways as numeric registers. Indirection can also be done on any register, not just the single index register on the HP-16C.
Ladybug takes advantage of the prompting functions on the HP-41 to allow for accessing stack registers in the same ways as numeric registers. Indirection can also be done on any register, not just the single index register on the HP-16C.


.. index:: zero fill mode, mode; zero fill, setting zero fill

Zero fill mode
==============

In the Programmer, the zero fill mode does not indicate available digits above the current window if they are all zero. The HP-16C will always indicate that there is more to see, even if it just fill 0 digits.
With Ladybug, the zero fill mode does not indicate available digits above the current window if they are all zero. The HP-16C will always indicate that there is more to see, even if it just fill 0 digits.

The reason for this difference is that it is believed that instantly knowing if there is anything non-zero to see outside the display is more useful, than to be constantly reminded that the word size is actually larger than what can be shown in a single display.

Expand All @@ -75,7 +75,7 @@ The reason for this difference is that it is believed that instantly knowing if
One complement mode
===================

The one complement mode is not present in the Programmer.
The one complement mode is not present in Ladybug.


.. index:: windows, display windows
Expand All @@ -85,7 +85,7 @@ Window display

The window display only provides for moving a full window at a time, not by single digits which is also available on the HP-16C.

The keyboard layout to do this does not require shift keys, which makes it somewhat easier to work with windows on the Programmer, compared to the HP-16C.
The keyboard layout to do this does not require shift keys, which makes it somewhat easier to work with windows with Ladybug, compared to the HP-16C.


.. index:: operations; double precision, double precision
Expand All @@ -101,29 +101,29 @@ Double divide will result in a double quotient. The HP-16C gives a single word q
Machine status
==============

There is currently no machine status display in the Programmer. Most of the information about the status is already visible in the display, the rest can be queried using ``WSIZE?`` or ``FS? 05`` for zero fill mode.
There is currently no machine status display in Ladybug. Most of the information about the status is already visible in the display, the rest can be queried using ``WSIZE?`` or ``FS? 05`` for zero fill mode.


Square root
===========

The Programmer does not offer an integer square root function, which is present on the HP-16C.
Ladybug does not offer an integer square root function, which is present on the HP-16C.


.. index:: floating point conversions, conversions; floating point

Floating point conversions
==========================

There are no support for floating point number conversions built in to the Programmer's module. It is something that is considered for a future extension.
There are no support for floating point number conversions built in to Ladybug at this point. It is something that is considered for a future extension.


.. index:: postfix operands, operands; postfix, prompting instructions, instructions; prompting

Prompting instructions
=======================

The Programmer takes full advantage of the prompting facility of the HP-41. Instructions such as ``MASKL`` and ``WSIZE`` prompt for their argument and are not limited to take it from the X register. To get the same behavior as on the HP-16C, use the indirect X postfix argument:
Ladybug takes full advantage of the prompting facility of the HP-41. Instructions such as ``MASKL`` and ``WSIZE`` prompt for their argument and are not limited to take it from the X register. To get the same behavior as on the HP-16C, use the indirect X postfix argument:

.. code-block:: ca65
Expand All @@ -138,4 +138,4 @@ Shift operations prompt for the shift count, which makes it unnecessary to have
Left justify
============

Is currently not present in Programmer.
Is currently not present in Ladybug.
2 changes: 1 addition & 1 deletion doc/fundamentals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This chapter covers numeric bases, word size, 2-complement and ranges.
Numeric bases
=============

The Programmer's module provides four numeric bases, binary (2), octal (8), decimal (10) and hexadecimal (16). Internally, numbers are represented as binary integers. The selected base controls the input and display of integers. The same binary number can be represented in any of the bases and it is easy to go between the bases. Thus, you can at any time during a calculation switch base to the one most suitable at that point. Any result (or partial result, thanks to RPN logic) can easily be shown in any available base.
Ladybug provides four numeric bases, binary (2), octal (8), decimal (10) and hexadecimal (16). Internally, numbers are represented as binary integers. The selected base controls the input and display of integers. The same binary number can be represented in any of the bases and it is easy to go between the bases. Thus, you can at any time during a calculation switch base to the one most suitable at that point. Any result (or partial result, thanks to RPN logic) can easily be shown in any available base.

Four keys (G-J) on the HP-41 keyboard represent ``HEXS``, ``DECS``, ``OCTS`` and ``BINS`` instructions that switch the base. Thus, switching base takes a single key press.

Expand Down
26 changes: 25 additions & 1 deletion doc/implementation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,28 @@ As the lower 56 bits are stored in the normal stack registers, it makes it easie

In addition to the extra bits for the stack, the buffer keeps track of all other things related to the integer mode. The complete integer state is preserved when you turn your calculator off. In fact, turning the HP-41 off and on will not cause the HP-41 to leave the integer mode. Integer mode stays active until you make an explicit switch to floating point mode (just press the gold shift key and the ``PI`` (0) key to get out of integer mode).

If you unplug the module with the Programmer, the next time you turn the HP-41 on, it will reclaim the buffer registers and make them available in the free memory pool.
If you unplug Ladybug, the next time you turn the HP-41 on, it will reclaim the buffer registers and make them available in the free memory pool.


Keboard layout
==============

The keyboard layout uses the existing similar functions on keys whenever possible. However, the stack manipulation operations ``RDN`` and ``X<>Y`` are moved to shifted keys as it was judged that digit entry is more important.

The base change keys are ordered in the same way as on the HP-16C and are located after the F digit.

The window key is the dot key. It was selected because the display uses dots to indicate presence of more windows. It is also very close to the 0-3 keys, so you will find the typical argument keys close to the window activation key.

The bit set, clear and test instructions are located on the row below the corresponding flag operations.

Negation is the same thing as ``CHS``, bitwise ``NOT`` on the same key (shifted) is closely related to negation.

Shift and rotate operations are plentiful. They are arranged together on the upper part of the keyboard.

Double operations are the shifted variant on the corresponding key. As these shifted keys are related to compares on the floating point keyboard and ``CMP`` actually is a subtraction, so it went to the subtraction key. ``TST`` is related to ``CMP``, so it was placed next to it.

The logical operations are held together in the usual order you say them, AND, OR, XOR, which also is the alphabetic order.

When you feel that you need to work with floating point numbers, you probably want to use that PI constant, so the ``FLOAT`` operation to switch to floating point mode is on the PI key.

Sign extension is on the ``EEX`` key, which is almost spelled the same.
7 changes: 3 additions & 4 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. programmer documentation master file, created by
.. ladybug documentation master file, created by
sphinx-quickstart on Wed Aug 10 20:45:33 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Programmer's module for the HP-41
=================================
Ladybug module for the HP-41
============================

Contents:

Expand All @@ -29,6 +29,5 @@ Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

16 changes: 10 additions & 6 deletions doc/introduction.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

************
Introduction
************

Welcome to the Programmer's module for the HP-41 calculator! The Programmer's module (or just Programmer for short), is a powerful tool, useful when you are debugging and working on low level matters related to computers.
Welcome to the Ladybug for the HP-41 calculator! Ladybug is a powerful tool, useful when you are debugging and working on low level matters related to computers.

It provides a new mode for you HP-41 calculator to allow it to work as a customizable integer binary calculator, use different number bases, perform bitwise and logical operations in a given word size. Such operations you typically will encounter when working with computers at the lowest level.

Expand All @@ -13,18 +12,23 @@ The main goal with this module is to blend the majority of the capabilities of a
Plug-in module
==============

The Programmer's module is a module image that needs to be put in some module hardware, like a Clonix module, an MLDL or some kind of ROM emulator. How you do this is beyond the scope of this manual.
Ladybug is a module image that needs to be put in some module hardware, like a Clonix module, an MLDL or some kind of ROM emulator. How you do this is beyond the scope of this manual.

The image configuration is a 3x4K module. Two banks occupies a single 4K page in the memory space together with a page 4 (takeover ROM). It can be plugged into any of the expansion ports (7-F) of the HP-41 expansion space, but the page 4 must go into address page 4.

The Programmer's module image is a 3x4K module. Two banks occupies a single 4K page in the memory space together with a page 4 (takeover ROM). It can be plugged into any of the expansion ports (7-F) of the HP-41 expansion space, but the page 4 must go into address page 4.

This release
============

This version, 0A is a release to early adopters, in the hope to get feedback. The instruction allocation (XROM numbers) is considered preliminary and may change.


.. index:: buffer, I/O buffer, XROM number

Resource requirements
=====================

The Programmer will allocate two registers from the pool of free memory. Apart from this, it does not impose any restrictions on the environment and will run comfortable on any HP-41C, HP-41CV or HP-41CX at standard speed.
Ladybug allocates two registers from the pool of free memory. Apart from this, it does not impose any restrictions on the environment and will run comfortable on any HP-41C, HP-41CV or HP-41CX at standard speed.

The XROM number used by this module is 16 and the private storage area is I/O buffer number 0.

Expand Down Expand Up @@ -66,6 +70,6 @@ Integer operations also work in program mode. You can write programs based on in
Copyright
=========

The Programmer's module and its manual is copyright by Håkan Thörngren 2016 and is provided free of charge for non-commercial usages. Contact the author if you want to use it for other purposes.
The Ladybug software and its manual is copyright by Håkan Thörngren 2016.

Feedback and suggestions are welcome, the author can be contacted at [email protected]
Loading

0 comments on commit 92306dc

Please sign in to comment.