Romasm Calculator

Full-featured graphics calculator powered entirely by Romasm assembly

Overview

The Romasm Calculator (romasm-calculator.html) is a TI-84-like calculator interface that performs all calculations using Romasm assembly. It includes function plotting, polar curves, parametric equations, and a console for running Romasm scripts.

Modes

Function Mode (y = f(x))

Plot standard functions where y is a function of x:

  • Define up to 8 functions (Y1-Y8)
  • Each function is Romasm assembly code
  • Input: R0 = x (scaled by 100)
  • Output: R0 = f(x) (scaled by 100)
; Example: Y1 = x²
LOAD R1, R0    ; Copy x to R1
MUL R0, R1     ; R0 = x * x = x²
LOAD R1, 100
DIV R0, R1     ; Scale down
RET

Polar Mode (r = f(θ))

Plot polar curves where r is a function of θ:

  • Define polar functions
  • Input: R0 = θ in degrees (scaled by 100)
  • Output: R0 = r (scaled by 100)
  • Automatically converts to Cartesian coordinates
; Example: r = cos(3θ)
LOAD R0, R0     ; θ
LOAD R1, 3
MUL R0, R1      ; 3θ
CALL cos        ; cos(3θ)
RET

Parametric Mode (x = f(t), y = g(t))

Plot parametric equations (coming soon).

Sequence Mode (u_n)

Plot sequences (coming soon).

Calculator Features

Y= Editor

Define and edit functions:

  • Click "Y=" button to open editor
  • Enter Romasm assembly for each function
  • Functions are automatically compiled and linked with stdlib

WINDOW Settings

Configure graph bounds:

  • X Min/Max: Horizontal range
  • Y Min/Max: Vertical range
  • θ Min/Max: Angle range (for polar mode)
  • Step Size: Resolution of plotting

ZOOM

Quick zoom presets:

  • Zoom In/Out
  • Zoom to fit
  • Standard window

TRACE

Trace along plotted functions to see exact values (coming soon).

GRAPH

Plot all enabled functions on the graph.

Calculator Mode

The calculator includes a home screen mode for direct expression evaluation:

  • Enter mathematical expressions
  • Expressions are parsed and converted to Romasm
  • Results are displayed on screen
  • Supports arithmetic, trigonometric functions, and more

Console

The calculator includes a Romasm console for running arbitrary scripts:

  • Write Romasm assembly code
  • Use drawing opcodes (MOVE, DRAW, STROKE, CLEAR)
  • Output coordinate pairs that auto-plot on graph
  • Pre-defined examples in dropdown

Standard Library Integration

The calculator automatically links with stdlib functions, so you can use:

  • CALL sin, CALL cos - Trigonometric functions
  • CALL sqrt - Square root
  • CALL exp, CALL ln - Advanced math
  • And all other stdlib functions

Related Documentation