Skip to content
brickpoolPublic

About

HP 35s scientific calculator

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

169 Commits

Folders and files

Repository files navigation

NAME

HP35s Assembler - translate symbolic assembler programs for the HP-35s

DESCRIPTION

This project parses HP-35s assembler source, resolves labels and named constants, and converts the resulting program to calculator keystrokes. It provides the Parser::HPC parser module and the asm2hpc.pl command-line frontend. The output is a readable or encoded keystroke listing, not machine code.

Assembler directives, symbols, and diagnostic messages are also described in the project wiki.

INSTALLATION

The runtime dependency is Parser::MGC version 0.16 or later. Install the distribution with the make utility configured for your Perl installation:

perl Makefile.PL
make
make test
make install

On Windows, use the make utility provided by the Perl distribution, such as dmake.

ASSEMBLER FRONTEND

Run the frontend from the project directory. It reads source from standard input unless an input file is specified; generated output is written to standard output and diagnostics to standard error.

perl -Ilib bin/asm2hpc.pl --help
perl -Ilib bin/asm2hpc.pl --unicode --file=examples/C/C.asm > C.35s

The frontend supports these options:

  • -?, --help

    Show usage information.

  • --man

    Show the full command documentation.

  • -v, --version

    Show the frontend version.

  • -f FILE, --file=FILE

    Read assembler source from a file instead of standard input.

  • -j, --jumpmark

    Mark jump targets in the listing.

  • -c, --clear

    Include keystrokes to clear calculator program memory. This requires shortcut output, enabled with --shortcut or --encoded.

  • -p, --plain

    Output a 7-bit ASCII listing.

  • -m, --markdown

    Output a Markdown listing with inline HTML.

  • -u, --unicode

    Output a UTF-8 listing.

  • -s, --shortcut

    Include shortcut keystrokes as comments.

  • -e, --encoded

    Output key codes in the macro encoding format.

  • --debug

    Write debug information to standard error.

For example, to create a plain-text listing or an encoded macro stream:

perl bin/asm2hpc.pl --plain --file=examples/C/C.asm > C.raw
perl bin/asm2hpc.pl --clear --encoded --file=examples/J/J.asm \
  | perl extras/tools/uudecode.pl

PARSER

Parser::HPC parses HP35s source and returns a Perl data structure containing its segments, labels, statements, and optional title and start address. Its supported grammar, programmatic usage, return structure, and limitations are documented in Parser::HPC.

EXAMPLES

The examples/ directory contains assembler programs and generated listings. The AppData/ directory contains emulator program files, while AppData/Macros/ contains macro files for importing or testing programs with the emulator.

About

HP 35s scientific calculator

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages