Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Japi Base Calc

A programmer's calculator for the Japi Base Computer: a value shown at once in hex, decimal, signed decimal (two's complement) and binary, with a selectable bit width (8/16/32/64), bitwise operations and ordinary arithmetic. The base you are entering in is highlighted, and a running tape logs the steps in that base.

It is a Japi Base Computer module -- its own repository, added to JapiBaseComputer as a git submodule, just like the editor and the BASIC.

Layout

src/calc.c, calc.h   the platform-free core: masking, arithmetic, bitwise,
                     parsing and formatting -- no VGA/keyboard dependency
src/calc_test.c      host self-test (run with `make test`)

The VGA + keyboard application layer (built against the Japi Base simulator, like the editor) is added next.

Build, test and run

make test            # run the core + engine self-tests on the host
make calc            # build the app against the Japi Base simulator
./build/calc         # run it (needs JapiBase checked out next to this repo)

Keys

0-9 A-F enter digits · + - * / % arithmetic · & | ^ ~ bitwise (AND/OR/XOR/NOT) · < > shift left/right · _ negate (two's complement) · Ctrl+H / Ctrl+D / Ctrl+B input base HEX/DEC/BIN · = compute · Bksp delete a digit · Del clear · F1 toggle the help panel · Esc quit.

The width is fixed at 64-bit, matching JBB's INTEGER.

Status

  • Core + engine + tests: done (self-checking suites green).
  • App (VGA + keyboard) on the simulator: done (make calc).
  • GitHub repo + submodule into JapiBaseComputer + Pico build: next.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages