Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 56

Thread: Oxygen Module for Structured Machine Code Programming

  1. #21
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Oxygen Module for Structured Machine Code Programming

    Yes I understand but multiline is there and ASM not and also not decided anything. And it will take some time.
    Also ASM will be specific of a particular module and not thinBAsic general Core engine so we will not able to follow its evolution from inside of thinBasic (as far as I can see).

    I think thinAir should have something in config that should say the beginning of the block and the end of the block in order to be automatically able to understand them whatever they are. Not to be specific to any particular syntax but general like:
    block: [FUNCTION][END FUNCTION]
    block: [SUB][END SUB]
    block: [BEGIN CONST][END CONST]
    ...

    PS: maybe better to split this part of the topic into thinAir forum.

    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #22

    Re: Oxygen Module for Structured Machine Code Programming

    Hi Eros and Roberto

    With Asm it is desirable to be able to use quote quote marks eg:

    mov al,"b" or db "piece of text"


    This would require thinBasic to use special markers to delineate a block of data instead of double-quotes. I suggest a pair of brackets, either [] or {} because of nestability. - Brackets are also used extensively within Asm itself

    I know this is a fundamental change to thinBasic syntax but I think it will help with syntax highlighting and support many other kinds of script or data passed to modules in general.

    [color=purple]MyAsmProc=O2_Asm {
    mov eax,#vv
    mov [eax], "helo"
    ..
    ret
    }


    please excuse my colors

  3. #23
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Oxygen Module for Structured Machine Code Programming

    Charles,

    who will be responsible to parse all code inside {...} of O2_Asm {...} ?
    If responsible to parse code will be module function linked to O2_Asm, I do not see much troubles.
    thinCore just need to parse first { and last } and pass all the inside code to O2_Asm function as string.

    This will also let to thinAir the freedom to remain as is because syntax will be very close to current parsed syntax.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #24

    Re: Oxygen Module for Structured Machine Code Programming

    Yes the entire content, including comments can be passed as a BSTR to the module. To avoid the nested brackets problem (for which you would need to parse the entire content) you could use keywords like this:

    dim sMc as string=Oxygen_Eval Script
    ..
    EndScript Oxygen_Eval

    In general terms:
    [module function name] script.. EndScript [module function name]

    This syntax could easily support scripts which may contain other scripts without getting too complicated

    pseudocode:
    read script
    do
    p=instr next_word_pos script, "endscript "
    if p=0 then p= len script+1: exit (error)
    w=nextword script
    if w=function_name then a=next_word_pos script: exit
    next_word_pos=this_word_pos
    loop
    if noerror then assign script ..








  5. #25

    Re: Oxygen Module for Structured Machine Code Programming

    Eros,

    A question about the FreeBasic interface: How did you generate libthinCore.dll.a ? Did you use dlltool and a DEF file ?

  6. #26
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Oxygen Module for Structured Machine Code Programming

    Attached file the .bat and .def file I use.

    In the .def file you declare the dll from which to export and the functions followed by @ followed by the number of bytes calling process expects to find into the stack.
    In the .bat file, the command I use.

    I remember it took some time for me to understand this process.

    Hope this can help.
    Eros
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  7. #27
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Oxygen Module for Structured Machine Code Programming

    Quote Originally Posted by Charles Pegge
    Yes the entire content, including comments can be passed as a BSTR to the module. To avoid the nested brackets problem (for which you would need to parse the entire content) you could use keywords like this:

    dim sMc as string=Oxygen_Eval Script
    ..
    EndScript Oxygen_Eval

    In general terms:
    [module function name] script.. EndScript [module function name]

    This syntax could easily support scripts which may contain other scripts without getting too complicated

    pseudocode:
    read script
    do
    p=instr next_word_pos script, "endscript "
    if p=0 then p= len script+1: exit (error)
    w=nextword script
    if w=function_name then a=next_word_pos script: exit
    next_word_pos=this_word_pos
    loop
    if noerror then assign script ..
    I will study your idea. Very interesting and very easy to manage by thinBasic parser.

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #28

    Re: Oxygen Module for Structured Machine Code Programming

    Charles,

    if there are difficulty inside the interpreters to manage a block (either machine code or assembler) is better to keep things simple (I mean use string or multi string) and try to solve the problem with marker inside the string.

    Ciao,
    Roberto
    http://www.thinbasic.com

  9. #29
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Oxygen Module for Structured Machine Code Programming

    Charles,

    see atached file and let me know if it can be ok for you.
    Mainly I've added (as you suggested) RAWTEXT/END RAWTEXT block.
    In theory inside that block there can be anything. If all OK a string containing the block will be returned.

    Ciao
    Eros

    Updated:
    • SCRIPT/END SCRIPT
      substituted with
      RAWTEXT/END RAWTEXT
    • 2008.03.16: added interface function thinBasic_VariableGetInfoEX. See thinCore.inc file inside zip file


    Attached file removed. Features present in current thinBasic preview version 1.6.0.2
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  10. #30
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Oxygen Module for Structured Machine Code Programming

    Hi Eros,

    fantastic! But as inside can be "anything", why not call it RAWTEXT / END RAWTEXT or similarly.
    Without the magic ( Charles module ) it has no script like functionality.

    Just idea, could be wrong, today I realised my bike has pierced pneumatic so I am in aggressive mood ;D


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Page 3 of 6 FirstFirst 12345 ... LastLast

Similar Threads

  1. Oxygen module source code on thinSVN server
    By ErosOlmi in forum thinSVN
    Replies: 8
    Last Post: 20-04-2009, 07:05

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •