Navigation

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

    64 Bit Assembly Intel compiler

    Work In Progress
    2
    9
    317
    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.
    • E
      EvanTropFun last edited by

      I work on a assembly compiler on fuze !
      Asm Intel 64 bit

      First images:

      alt text

      alt text

      Like the assembler, I reproduced the 64 bit registers !

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

        Nice to see more people interested in this field. Nice work!

        E 1 Reply Last reply Reply Quote 1
        • E
          EvanTropFun @LucasJG25 last edited by

          @LucasJG25 Thanks you ! I work ! i work !

          1 Reply Last reply Reply Quote 2
          • E
            EvanTropFun last edited by

            Update:

            Added JMP = Jump on a instruction

            Added CMP command to conditional event for jump
            With :

            JE, JA, JB, JBE, JG, JLE, JNE

            Added INC = increment

            Added ADD to add
            Added SUB to substract

            Added PUSH and POP

            Added new kernel command

            Basically I'll finish it today or tomorrow

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

              Are you interpreting the assembly as is or translating it to bytecode?

              1 Reply Last reply Reply Quote 0
              • E
                EvanTropFun last edited by

                I interpret the assembler. I simulate the registers in an array and we can write the code in a string the character string is processed by conditions which look at the commands type and do what the instruction does

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

                  Ah ok. Sounds like a good plan. Looking forward to trying it out!

                  1 Reply Last reply Reply Quote 0
                  • E
                    EvanTropFun last edited by

                    ASSEMBLY INTERPRETOR
                    Share Code : NDFYADND9P

                    Exemple

                    Want to make a simple hello world ?

                    First make variables with the hello world message
                    with this syntax :

                    variable: db ValueOrText

                    db for store simple element text or value

                    So in first we must write this :

                    message: db Hello World!

                    Now for draw this message on the screen we need system function
                    controled by registers.

                    Registers are useful for storing data temporarily and are used for function parameters
                    We can modify their value with MOV arg1 arg2 = arg1 = arg2

                    The Print Function:

                    mov rax 1 ; 1 = print
                    mov rdi 1 ; 1 = stdout
                    mov rsi message ; a variable with the string or the value
                    mov rdx lenMsg ; lenght of the message
                    

                    For the lenght of the message it's easy :

                    msgLen: len message

                    and now you can write a SYSCALL for execute the function

                    
                    message: db Hello World!
                    msgLen: len message
                    
                    mov rax 1
                    mov rdi 1
                    mov rsi message
                    mov rdx lenMsg
                    syscall
                    
                    

                    Documentation

                    Basic textual function:

                    Print :

                    mov rax 1 ; 1 = print
                    mov rdi 1 ; 1 = stdout
                    mov rsi message ; a variable with the string or the value
                    mov rdx lenMsg ; lenght of the message

                    GetUserInput :

                    mov rax 1 ; 1 = print with STDIN print in rsi
                    mov rdi 2 ; 1 = stdin

                    The input is in rsi register

                    ClearScreen :

                    mov rax 2 ; clear the screen

                    ClearScreenEx :

                    mov rax 3 ; clear the screen with color
                    mov rdi R ; Red
                    mov rsi G ; Green
                    mov rdx B ; Blue

                    Ink :

                    mov rax 4 ; change the text color
                    mov rdi R ; Red
                    mov rsi G ; Green
                    mov rdx B ; Blue

                    Information Treatment Function

                    getTextLen:

                    mov rax 10 ; Get the lenght of a String
                    mov rdx text :The text to get the lenght

                    Recovered the text lenght in rsi.

                    getButtonPressed:

                    mov rax 11
                    Recovered in rdi.

                    0 = A
                    1 = B
                    2 = Y
                    3 = X
                    4 = LEFT
                    5 = RIGHT
                    6 = UP
                    7 = DOWN
                    8 = L
                    9 = R
                    10 = zl
                    11 = zr

                    Math Function

                    RANDOM:

                    mov rax 20 ; generate random number
                    mov rdi number ; Maximal value of the random number

                    Recovered in rsi.

                    FLOOR:

                    mov rax 21 ; floor
                    mov rsi Value ; Number to floor

                    Recovered in rdi

                    Graphics Function

                    drawText:

                    mov rax 40 ; drawText
                    mov rdi X ; X position
                    mov rsi Y ; Y position
                    mov rdx SIZE ; size of the text
                    mov r8 R ; Red Color
                    mov r9 G ; Green Color
                    mov r10 B ; Blue Color
                    mov r11 message ; text to display
                    mov r12 lenText ; lenght of the text

                    drawBox:

                    mov rax 41 ; drawBox
                    mov rdi X ; X position
                    mov rsi Y ; Y position
                    mov r8 width ; width
                    mov r9 height ; height
                    mov r10 R ;
                    mov r11 G ; --Color
                    mov r12 B ;/
                    mov r13 mode ; 0 fill 1 not fill

                    drawCircle:

                    mov rax 42 ; drawCircle
                    mov rdi X ; X position
                    mov rsi Y ; Y position
                    mov r8 radius ; radius
                    mov r9 numPoint ; numpoint
                    mov r10 R ;
                    mov r11 G ; --Color
                    mov r12 B ;/
                    mov r13 mode ; 0 fill 1 not fill

                    drawLine:

                    mov rax 42 ; drawLine
                    mov rdi X ; X position
                    mov rsi Y ; Y position
                    mov r8 x2
                    mov r9 y2
                    mov r10 R ;
                    mov r11 G ; --Color
                    mov r12 B ;/

                    EXIT SUCCESS FUNCTION

                    mov rax 60 ;exit success

                    1 Reply Last reply Reply Quote 4
                    • E
                      EvanTropFun last edited by EvanTropFun

                      And too there is all assembleur command :

                      mov arg1 arg2
                      add arg1 arg2
                      sub arg1 arg2
                      inc arg1
                      jmp arg1
                      cmp arg1 arg2
                      etc
                      
                      1 Reply Last reply Reply Quote 2
                      • First post
                        Last post