Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    A simple esolang interpreter

    Creation share codes
    5
    72
    5848
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      LucasJG25 last edited by LucasJG25

      Post Re-written

      Language specs:

      LD <reg>, (<sym><num> | "*"<label>) LOAD
      CMP <reg>, (<sym><num> | "*"<label>) COMPARE
      ADD <reg>, (<sym><num> | "*"<label>) ADD
      SUB <reg>, (<sym><num> | "*"<label>) SUB
      ST <reg>, (<sym><num> | "*"<label>) STORE
      JMP <label> JUMP if flag == 2
      JGT <label> JUMP if flag == 1
      JLT <label> JUMP if flag == 4
      CLR <- clear the screen buffer.
      i <- input stream
      P <- display entire screen
      
      <label> ::= "a-zA-Z0-9_"
      ":"<label>"$"<num> 
      "@"<label> 
      

      RAM Mapping
      RAM[39998] = keyboard input
      RAM[40000 - 65000] = Screen Memory

      Registers
      Acc -> Accumulator
      X -> Register X ---| General Purpose Register
      Y -> Register Y ---| General Purpose Register

      1 bit per pixel
      Allowing 8 pixels per byte.

      Text Mode Removed

      Shared Code
      NNK97RND9K

      1 Reply Last reply Reply Quote 5
      • JMM161437
        JMM161437 F last edited by

        This looks very interesting and I am excited to try it out!

        L 1 Reply Last reply Reply Quote 1
        • vinicity
          vinicity F last edited by

          This is insanely cool! You made a working computer language within Fuze! Super impressed!

          L 1 Reply Last reply Reply Quote 1
          • L
            LucasJG25 @JMM161437 last edited by

            @JMM161437 thanks! :D

            1 Reply Last reply Reply Quote 1
            • L
              LucasJG25 @vinicity last edited by

              @vinicity Thanks! Always wanted to try making an interpreter.

              1 Reply Last reply Reply Quote 1
              • PickleCatStars
                PickleCatStars F last edited by

                Esoteric indeed!

                1 Reply Last reply Reply Quote 1
                • JMM161437
                  JMM161437 F last edited by

                  I've never heard of Esolang nor seen anything like it but it kinda reminds me of assembly the way to describe the functions of each instruction . Which makes me even more excited!

                  L 1 Reply Last reply Reply Quote 1
                  • L
                    LucasJG25 @JMM161437 last edited by

                    @JMM161437 Very happy that you're excited! I'm looking forward to see what you'll do with this esolang.

                    1 Reply Last reply Reply Quote 1
                    • JMM161437
                      JMM161437 F last edited by

                      @LucasJG25 I just tried to download it and nothing... is it still pending?

                      pianofire L 3 Replies Last reply Reply Quote 0
                      • pianofire
                        pianofire Fuze Team @JMM161437 last edited by

                        @JMM161437 I think it was approved but has been updated so is awaiting approval again

                        1 Reply Last reply Reply Quote 0
                        • L
                          LucasJG25 @JMM161437 last edited by

                          @JMM161437 Sorry about that. I had to make a last minute fix.

                          1 Reply Last reply Reply Quote 0
                          • L
                            LucasJG25 @JMM161437 last edited by

                            @JMM161437 It's live now

                            1 Reply Last reply Reply Quote 0
                            • JMM161437
                              JMM161437 F last edited by

                              Thanks I'll definitely check it out!

                              1 Reply Last reply Reply Quote 1
                              • JMM161437
                                JMM161437 F last edited by

                                So it's a bit of a learning curve for me but wow is it amazing... Sorry if I seemed over excited just a fan of programming in a new way!

                                L 1 Reply Last reply Reply Quote 2
                                • L
                                  LucasJG25 @JMM161437 last edited by

                                  @JMM161437 That's ok :D. Glad you like it.

                                  1 Reply Last reply Reply Quote 1
                                  • L
                                    LucasJG25 last edited by

                                    Ok so. I've ported this esolang to windows via C. And I made a bit of changes to the language.

                                    The instructions are the same. But it's how you write the code.

                                    The code above uses the ':' to separate each line of code.
                                    ex:
                                    I 0 : i : L 255 : P : C 0 : J 0 : j 0

                                    On the windows port I removed the ':' so now you have.
                                    ex:
                                    I0 i L255 P C0 J0 j0

                                    If Y'all prefer the second syntax I can make changes to the code to accept this syntax instead of the first.

                                    1 Reply Last reply Reply Quote 0
                                    • vinicity
                                      vinicity F last edited by

                                      Hmm, how do I do subtraction and comparisons with ">" or "<"?

                                      L 1 Reply Last reply Reply Quote 0
                                      • L
                                        LucasJG25 @vinicity last edited by LucasJG25

                                        @vinicity You subtract by adding 255 to the said number. Example: (I 5 : A 255) This makes Acc become 4. Since Acc when it has reached the highest amount of bits within the range of 0x00 to 0xFF. resets itself to 0.

                                        Comparisons are done using the C instruction. So the capital C compares an immediate value with Acc. There are no negative numbers in this VM. So if you are for example at 0 and want to loop until you reach 5. You'll need to store the amount of loops in RAM or in register X and then compare if that number has reached 0, since you will be subtracting RAM/ register X after each loop.

                                        1 Reply Last reply Reply Quote 2
                                        • L
                                          LucasJG25 last edited by LucasJG25

                                          Thought I'd try writing a BrainF interpreter in my esolang. Wrote this on the windows version. It should work for the FUZE4 version as it's the same VM and same code.
                                          ;Register X => Stack Pointer
                                          ;RAM[253] => Program Counter
                                          ;RAM[252] => Scanner Pointer
                                          ;RAM[251] => Internal RAM for BrainF Interpreter
                                          ;Setup X register and RAM address 253,252,251 and 250
                                          I49 U I50 S253 S252 I150 S251 I149 S250 C0 j210

                                          (20)
                                          ;if token is 60 = '<'
                                          L251 C150 J197 A255 S251 C0 j197

                                          (40)
                                          ;if token is 62 = '>'
                                          L251 C249 J197 A1 S251 C0 j197

                                          (60)
                                          ;if token is 44 = ','
                                          I0 i L254 C0 J60 s251 C0 j197

                                          (80)
                                          ;if token is 46 = '.'
                                          l251 P C0 J197 j197

                                          (90)
                                          ;if token is 43 = '+'
                                          l251 A1 s251 C0 j197

                                          (100)
                                          ;if token is 45 = '-'
                                          l251 C0 J197 A255 s251 C0 j197

                                          (120)
                                          ;if token is 91 = '['
                                          L253 u G A255 U C0 j197

                                          (140)
                                          ;if token is 93 = ']'
                                          G A1 U l251 C0 J197 g S253 C0 j120

                                          (180)
                                          ;Scan the tokens <>,.[]+- line 88
                                          l253 C60 J20 C62 J40 C44 J60 C46 J80 C43 J90 C45 J100 C91 J120 C93 J140
                                          L253 C150 J225 A1 S253 C0 j180

                                          (210)
                                          ;Get keyboard input and execute code when ENTER is pressed line 112
                                          I0 i L254 C0 J210 P C10 J180 s252 L252 A1 S252 C0 j210

                                          (225) ;Reset Program Counter and erase old data from scanner
                                          I50 S253 I0 s252 L252 A255 S252 C50 j225 I10 P J210

                                          1 Reply Last reply Reply Quote 2
                                          • JMM161437
                                            JMM161437 F last edited by

                                            the most I could make was a simple calculator for addition o.o

                                            L 1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post