Results 1 to 6 of 6

Thread: Asmosphere Legacy Download

  1. #1

    Asmosphere Legacy Download

    Note:

    This module is being replaced by a new version of Oxygen which also supports BASIC syntax
    including OOP, and programmable operators. You can find it here:

    http://community.thinbasic.com/index.php?topic=2517






    This is an assembler, which supports x86 instructions including 3DNOW and SSE1..SSE4.

    It also has a preprocessor implementing multiline macros and some specialised syntax for simple binding to DLLs, and making library calls using C-like syntax.

    The preprocessor macros have local scope which allows words to be temporarily defined for a particular context - like natural speech! Almost any word or symbol can be redefined in this way.

    The source string does not need to use single or double quote marks so it works freely with thinBasic multiline strings. Furthermore quote marks, brackets and comment marks can be reprogrammed at any point in the script.

    Asmosphere generates O2 script which in turn produces a linked executable binary code string. This can be called directly or stored for later use.

    Asmosphere together with O2 are contained in the thinBasic_Oxygen.dll module.

    The Assembler itself is a large single function that breaks some of the conventions of structured programming. However this architecture has proven to be very simple to manage and debugging was very straightforward. I use a minimalist subset of Basic to make the programming logic as plain as possible. The FreeBasic source code is included in the Zip below.

    There is also a preprocessor and macro system which confers many features only found in higher level languages. Recent developments support OOP models compatible with COM programming, offering both single and multiple inheritance.

    Attached Files Attached Files

  2. #2

    Asmosphere Updates

    Updated 29 September 2008
    H2O development ongoing
    minor fixes: segment overrides and direct 16 bit shifts on mem operands

    Updated 22 September 2008
    These additions are required for H2O but also help to make cleaner structures
    exit 2 3 .. exit more than one nesting level
    jmp fwd abc jump or call to a forward label (prevents linking to earlier label)
    indexers static indexers local (locals are offset from the ebp register)
    colon statement separators (like BASIC)
    typeof structureof scriptof string literals for inspecting types, classes etc
    fix negative literal macro params: mydef -2 -0.1 -.1 etc


    Updated 17 September 2008
    Creating dynamic objects using &:
    var &myclass myobj
    myobj=getmemory sizeof myclass
    ...
    freememory myobj

    Updated 7 September 2008
    Private Members: indicated by -
    Abstract Members: - 0-byte members
    defs equate sets
    improved assignments.
    (fix hash table carryover)

    Updated 5 September 2008
    Adaptations for COM programming - of ... single inheritance option

    Updated 2 September 2008
    typeof offsetof sizeof Info constants extended for named inherited structures.
    Bug fix for comments in defs and types.

    Updated 1 September 2008
    static scopes to improve encapsulation
    kernel const pointer to Oxygen runtime functions
    Include source code for Oxygen.dll as well as thinBasic_Oxygen

    Updated 31 August 2008
    Overloading for OOP methods (system for matching function signatures: same name, several methods)
    Also new with instruction

    Updated 28 August 2008
    OOP model with virtual tables and multiple inheritance
    Indirect assignments **a=*b address assignments c=&d
    Unions: type tvecs 4 x 4 y 4 z 4 w = 4 red 4 green 4 blue 4 alpha

    Updated 22 August 2008
    TOMDK for developin thinBasic modules using Oxygen.
    (fixed code buffer overflow caused by large macros. - also spurious recursion error)
    fixed anomalies caused by mixing %a %b and %e / several instances in same macro.

    Updated 16 August 2008
    Assembly speed enhancement using hash tables.
    new o2 instruction to specify an exact location for a label.
    Example demonstrating creation of StandAlone EXEs or DLLs

    Updated 12 July 2008
    Correction to support multiline Type defs.
    Procs accept floating point literals (single precision).
    Multiline procs will now allow comments.
    Var arrays allow comments at end of line.
    Reportable run-time errors: dll bind failures.

    Updated 4 July 2008
    Reincorporate soft-coded instructions back into oxygen module
    no need for o2asm.data - (this simplifies bundling)


    Updated 29 June 2008
    multi symbol and multiword names
    def `` 3
    def `old mick` 666

    Updated 24 June 2008
    vald and strd functions for converting strings/doubles
    symbol pair macros ++ == += etc

    Updated 22 June 2008
    Performance improvements

    Updated 21 June 2008
    reprogrammable symbols
    Experimental OOP model
    %b %a %e multi word parameters for macros
    +minor updates to both Oxygen and manual

    Updated 16 June 2008
    Update to manual: first draft of Omerlin code spells.

    Updated 11 June 2008
    Using own allocation system instead of SysAllocString/SysFreeString for getmemory/freememory functions

    Updated 10 June 2008
    Data structures : Macro params : Runtime intrinsic functions : Fast Entry points
    DLL proc binding : Fully relocatable/storable code
    (remove $ suffix on all macros)

    Updated 30April 2008
    Soft coding with 250 opcodes held in editable data file
    Improvement in Assembly parsing speed
    Corrections to 3DNOW codings.

    Updated 23 April 2008
    Added O2_VIEW_FILE(src).
    Support def #variable overrides (overriding parent binding)
    Fixed Hexadecimal and octal literals

    Updated 15 April 2008
    Instruction Set with SSE3 (Prescott) SSE4 3DNOW
    operand corrections for pmovmskb pshupfs and pextrb/w pinsrw

    Updated 13 April 2008
    Full instruction set to SSE2
    Execute files as well as inline scripts
    Separate preprocessor layer

    Update 29 March 2008

  3. #3

    Re: Asmosphere Download

    O2 Instruction set.

    21 September 2008

    This is the lowest layer mainly dedicated to linking, number conversion
    and production of executable binary.


    ------------------------------------------------------------------------

    all words are delimited by white space or comment mark

    2 digits 0-9 a-f hexadecimal byte
    3 digits 0-7 octal byte

    ' comment to end of line
    ; comment to end of line
    " quote mark
    ` quote mark
    .label labels (not case sensitive)
    $ make space (value in hexadecimal)
    $$ make space & align to nearest 4 bytes
    ! Align to block infill with NOPs
    eg: !10 align to 16 bytes with 90 90 ..
    g short forward relative jump (but not into an inner block)
    gl long relative jump (ditto)
    gf long (forward only) relative jump (ditto)
    ga offset of label (labels of inner blocks are invisible)
    / set offset address, infill with nulls
    eg: /1000 align to 4096 bytes
    /+ round-up offset , infill with nulls
    eg: /+100 align to next 256 byte unit.
    ( start of block
    ) end of block
    x short jump exit from block
    xl long jump exit from block
    r short jump repeat from start of block
    rl long jump repeat from start of block
    h hexadecimal numbers:
    hw word: 2 byte integer
    hl long: 4 byte integer
    n decimal numbers:
    nb byte 1 byte
    nw word: 2 byte integer
    nl long: 4 byte integer
    nq quad: 8 byte integer
    ns single: 4 byte floating point
    nd double: 8 byte floating point
    #name an absolute address resolved by the host system
    ------------------------------------------------------------------------

  4. #4

    Re: Asmosphere Download

    Oxygen Preprocessor Instruction Set Outline

    22 September 2008


    _________________________________________________
    bind bind dll calls dll calls can then be invoked directly
    build build virtual table addresses for classes and jump tables
    copy0 copy asciiz string runtime copying of strings
    copy00 copy widestring 16 bit characters terminating with 0000h
    copyn copy n bytes of string specific length but any bytes
    data data block for inline data in O2 format
    dataspace inline space for variables and data
    def macro define macros
    defs constants define set of contants
    exit exit block exit one or more blocks (nested)
    freelibrary free DLL disconnect from DLL (may unload itself)
    freememory free system memory free string allocated by OS
    getmemory get block of system memory allocated by OS
    getprocaddress get DLL procedure address if it exists or null
    incl include macro include macro but prevent %params
    include include source file to insert into main body of code
    indexers define index base for variables
    loadlibrary load DLL Load DLL & get its handle
    o2 O" script block drop down into O2 machine code / data / linker layer
    offset index base offset for variables
    offsetof offset of variable or element within a variable of type
    proc procedure make procedure call
    repeat repeat block jump back to the beginning
    scriptof script string raw structure script for type or variable
    sizeof size of variable or type or element within
    skip skip block ignore block of code
    spanof span of array dimension specified in bytes, supports multi dimensions
    static continue index base beyond end of scope
    statusof status of elements of an element in an object or class (method/property etc)
    structureof structure string resolved structure of type or variable
    symbols redefine symbols change brackets quotes and comments
    type define type including classes
    var variables declare variables
    with asignment prefix to save repetition of long names


  5. #5

    Re: Asmosphere Download

    Oxygen Preprocessor Symbols / Punctuation

    22 September 2008



    " ` Quote marks for string literals (" can't be used in thinbasic inline source)
    ; ' Comments for remarks and also disabling lines of code
    . : labels Labels may begin with a dot or end with a colon
    . dotted variables elements of objects (including methods). also set constants(defs)
    : colons statements may be separated with a colon instead of new lines
    , separator used for separatng parameters, mostly optional
    * pointer used for indirect addressing
    & address of used to pass variables by reference
    ( start of block blocks define scope and looping target for repeat
    ) end of block marks the end point target for exit
    # host variable address of thinBasic variable at compile time[/b]
    ## host variable address of thinBasic variable at run time[/b]
    = assignment transfer data to left side from right side (registers or variables) [/b]
    % macro parameters used in macros for word substitution




  6. #6

    Re: Asmosphere Download

    Oxygen Preprocessor Macro Symbols

    22 September 2008




    %% Escape % replace with one less % eg %%% becomes %%
    %0 swallow 1 word to the left replace all instances with this word
    %1 swallow 1 word to the right replace all instances with first word
    %2 swallow 2 words to the right replace all instances with second word
    %3 swallow 3rd words to the right replace all instances with third word
    swallow up to 9 words to the right replace all instances with nth word
    %b swallow words to the left replace all instances with left part of line
    %e swallow words to the right replace all instances with rest of line or block
    %h hexadecimal ascii replace with single ascii character
    %l insert line break allows macro to be defined on a single line
    %n use macro as is no further substitution of % paramsin current macro




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
  •