Uhidklol
Jump to navigation
Jump to search
uhidklol: a no whitespace asm-like language.
language documentation
instructions
i [var]
= input data in varo [reg]
= output data in regc [reg] [value]
= set reg to valuej [line]
= jump to linea [value] [var]
= add value to already existing value in vars
= same but substract (same syntax)m
= same but multiply (same syntax)d
= same but divide (same syntax)q
= quit program
registers
$var
= variable store$ath
= arithmetic operations$ds1-4
= data store 1-4, these are basically buffers
other info
- the "value" arg in any instruction can also be a register (and therefore also a variable)
- variables are automatically stored in register
$var
, up to 16 different variables of 4 bytes each (that means 4 characters max, "varname" is a placeholder, its too long to be a valid one) - the output of the instructions
a s m d
is automatically stored in$ath
- every register is the same size, that means, 64 bytes
- whitespace = line end
- there can only be 1 instruction per line, and every line that isnt commented out must be an instruction
- arguments must be separated from each other by a comma, but never the first (or only) arg from the instruction.
- each instruction MUST be separated with whitespace. it can be any type of whitespace as long as its in the ascii table
- to encode whitespace in strings, it goes like if it were an url:
%20
= space,%0A
= newline,%09
= tab - when referring to any variable, it must be preceded by a dot. they dont need to be declared (being similar to how basic treats them, where any string ending with "$" becomes a variable). if theres a
%20
between the dot and the following part of the string, this rule wont apply - each new (not comment) line MUST begin with a line number. line numbers must NOT skip numbers, be in base 16, the letter part MUST be uppercase and be preceded by
#
- instruction/register names MUST be lowercase,
%
encoding MUST be uppercase if it includes a letter - every argument is case sensitive
- uhidklol CANT handle any code pages nor unicode, its just plain ascii
- preceding any string with
@
turns it into a comment until next instance of@
(this is the only instruction/symbol that admits not%
encoded whitespace, including newlines) - preceding with
!
any of the special characters# $ . ! @ , %
escapes them. wont apply to any whitespace character
example programs
hello world
#1c$ds1,hello%20world #2o$ds1
infinite loop
#1a0,.varname #2j#1
cat
#1i.varname #2o$var