brickpool / hp35s

HP 35s scientific calculator

Home Page:https://github.com/brickpool/hp35s/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HP-35s scientific calculator

An Assembler asm2hpc.pl prepares the programs for HP-35s. Assembler programs (*.asm) benefit from the symbolic resolution of labels, named constants and simple macro functions.

Perl (*.pl or *.pm) is used as the implementation language for the Assembler.

The machine code is not directly available, a well-formatted, ready-to-use format (*.txt option -p or *.35s option -u) with all numbered lines, all labels and jump labels (option -j) will be generated by the Assembler.

The associated key strokes can optionally be output as a comment by the Assembler (option -s).

It can be very helpful to import the programs by using the Emulator Macro funnction to test the program logic (AppData/Marcos/*.mac option -e).

Install

To install the HP Calculator Parser module for the Assembler type the following:

perl Makefile.PL
make
make install

Usage

The assembler directives, symbols and error messages are described in the wiki.

The Perl script asm2hcp.pl converts an assembler program to HP35s native program code (Reverse Polish Notation).

asm2hpc.pl --help
USAGE:
  c:> type <asm-file> | perl asm2hpc.pl [options] 1> outfile.35s 2> outfile.err

VERSION: v0.4.0
  Web: http://www.brickpool.de/

OPTIONS:
  -h, --help          Print this text
  -v, --version       Prints version
  -j, --jumpmark      Prints an asterisk (*) at the jump target
  -c, --clear         Prints keystrokes to delete the program memory
  -p, --plain         Output as Plain text (7-bit ASCII)
  -m, --markdown      Output as Markdown (inline HTML 5)
  -u, --unicode       Output as Unicode (UTF-8)
  -s, --shortcut      Output shortcut keys as comment
  -e, --encoded       Output key codes as Macros (UU Encoding)
  --debug             Show debug information on STDERR

  --file=<asm-file>:
    Location of asm-file (Default is STDIN)

This script converts an assembler program to HP35s native program code
The output will be sent to STDOUT

Examples

The examples/ directory has a few simple examples of what you can do with the Assembler syntax:

perl -Ilib asm2hpc.pl --file=examples/C/C.asm > examples/C/C.txt
perl -Ilib asm2hpc.pl --plain --file=examples/C/C.asm > examples/C/C.raw
perl -Ilib asm2hpc.pl --unicode --shortcut --file=examples/C/C.asm > examples/C/C.35s
perl -Ilib asm2hpc.pl -c -e -f examples\J\J.asm | extras\tools\uudecode.pl

Each example has a ready-to-use emulation file (AppData/*.ep) to load the program directly to your PC version of the HP 35s calculator.

About

HP 35s scientific calculator

https://github.com/brickpool/hp35s/wiki

License:MIT License


Languages

Language:Perl 85.2%Language:HTML 12.6%Language:Raku 2.3%