User:Gamax92/Jstar 1000

JStar 1000 is an interpreted programming language, developed by someone. JStar 1000 programs are ran on a JStar 1000 virtual machine. The purpose of the language was to provide a simpler environment for the machine the language was used on.

Memory
JStar 1000 has at max memory of 4K, ranging from 200h to FFFh. The reason for this range is that the first 512 bytes are reserved for the system. The machines this language was written for originally had an interpreter, system font, disk space, and the subroutine stack. When loading in a rom, make sure to load it in at 200h

The display also has 2K of memory, used to store the gray-scale value of each pixel.

Storage
The JStar 1000 offered 16 bytes to each rom. A rom must write a 2 byte identification code to the system ram at 1FE before using the system disk loading and saving commands. Failure to do this when using these commands will result in the system instead ignoring the request and setting register 16 to 1, else 0.

Registers
JStar 1000 has 16 8-bit data registers named V0 to VE, the 16th register is also 8-bit, but is also reserved for carry/borrow flag.

There are also 2 16-bit registers called PC and DP. PC is used to store the Execution pointer for the system and DP is used to store drawing addresses.

The stack
The stack is only used to store addresses for when subroutines are called. The original version allocated 16 bytes of ram to allow up to 8 return points. If the stack is used up, the jump command fails and instead the 16th register is set to 1, else 0.

Timers
JStar 1000 has two 8-bit timers. They both count down at 60Hz by default until they hit zero.

There is a system opcode that allows for reconfiguration of both these timer's speed, and the processors speed. The processor speed defaults to 1MHz.

Input
Input is done with a numeric keypad and an arrow pad, similar to the intellivision. The numeric pad ranges from 0 to 9, while the direction pads are assigned: Left = Ah, Up = Bh, Right = Ch, Down = Dh

Graphics and sound
The resolution of the JStar 1000 is 64x32, and its color is grayscale. Graphics can be drawn to the screen either by Sprites or pixels, in modes XOR or OR. The system font is 4x5 and is stored as binary sprites. The letters available are 0-9, and A-Z capitals.

A system opcode is available to make a beep using a pitch. The pitch scale is currently unknown.

Opcode table
All opcodes that deal with adding or subtracting will affect Register 16. If an overflow is detected, the register will be set to 1, or else it will be set to 0.