Skip to content

harrcorr/TapeScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

TapeScript

TapeScript is a interpreted programming language/very rough cpu emulator I built for fun
Feel free to make a PR if you wanna upgrade it

Features of TapeScript

  • Basic ADD/SUB arithmetic operations
  • A Ranging in size Tape/memory
  • Adjustable clock speed
  • Fully visible stack and registers
  • Support for conditional branching

    Datatypes

    Name Internal c++ Datatype How to specify
    INT int How to specify
    REGISTER std::string "(register name)"
    STRING std::string no explicit specification required
    MEM int use 0x prefix on whatever number
    OTHER std::string/int no explicit declaration required

    Instruction Set

    Instruction Args Usage
    LOADA INT/STRING Load an integer into the A register either directly or from another register
    LOADB INT/STRING Load an integer into the B register either directly or from another register
    LOADC INT/STRING Load an integer into the C register either directly or from another register
    PRINT REGISTER/MEM/OTHER Print data either from a register a memory address or directly print whatever is specified in the file
    STORE REGISTER Store data from at the current StackPointer location
    SHIFTLEFT N/A Shift the StackPointer left (-1)
    SHIFTRIGHT N/A Shift the StackPointer right (+1)
    SET REGISTER , REGISTER Set data from any register to any other register
    ADD REGISTER , REGISTER Compute add operation of the data in the two specified registers and store in the "MathOp" register
    SUB REGISTER , REGISTER Compute subtract operation of the data in the two specified registers and store in the "MathOp" register
    JMP LABEL This will change the "InstructionPointer" register to the location of the specified label
    IF REGISTER , REGISTER , (any instruction) if the data in two specified registers is equal execute anything placed after the second register

    Q/A

    Does it do much?
    No.
    Is it useful?
    No.
    Does it work?
    Mhmm kinda...
    Why does a programming language have registers?
    To be honest i have no idea
    Ive now seen how amazing this code is how do i use it?
    Simply clone the directory and run make i have only used standard g++ libs and one linux lib if you dont have the linux lib take it out and replace main.cpp:103 system("clear") and main.cpp:97 sleep(clockSpeed) with your operating systems equivalent

  • About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published