Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: Further Developments in Asmosphere II

  1. #11
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Further Developments in Asmosphere II

    Charles, that scares me as much as it amazes me
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  2. #12
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Further Developments in Asmosphere II

    Ok, I decided to see if I can make any progress on this stuff and am lost

    I thought well let me show what I am trying to do and maybe I can figure out how to study up and get to using this power.

    I am going to go through the html version of The Art of Assembly
    This page is a good start.
    http://webster.cs.ucr.edu/AoA/Window...loWorlda3.html

    If you scroll down to the sample code for:
    program DemoMOVaddSUB;

    How can I take what I see in the online book as this and use with ASMosphere and Oxygen?
    An example like this will go a long way to help, thanks Charles!
    program DemoMOVaddSUB;



    #include( "stdlib.hhf" );



    static

    i8: int8 := -8;

    i16: int16 := -16;

    i32: int32 := -32;



    begin DemoMOVaddSUB;



    // First, print the initial values

    // of our variables.



    stdout.put

    (

    nl,

    "Initialized values: i8=", i8,

    ", i16=", i16,

    ", i32=", i32,

    nl

    );



    // Compute the absolute value of the

    // three different variables and

    // print the result.

    // Note, since all the numbers are

    // negative, we have to negate them.

    // Using only the MOV, ADD, and SUB

    // instruction, we can negate a value

    // by subtracting it from zero.



    mov( 0, al ); // Compute i8 := -i8;

    sub( i8, al );

    mov( al, i8 );



    mov( 0, ax ); // Compute i16 := -i16;

    sub( i16, ax );

    mov( ax, i16 );



    mov( 0, eax ); // Compute i32 := -i32;

    sub( i32, eax );

    mov( eax, i32 );



    // Display the absolute values:



    stdout.put

    (

    nl,

    "After negation: i8=", i8,

    ", i16=", i16,

    ", i32=", i32,

    nl

    );



    // Demonstrate ADD and constant-to-memory

    // operations:



    add( 32323200, i32 );

    stdout.put( nl, "After ADD: i32=", i32, nl );







    end DemoMOVaddSUB;
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  3. #13
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Further Developments in Asmosphere II

    Or, since this is based on his High Level Assembly language perhaps it is not the best one to study?

    If you know of or can point to another site to learn and then how that site's code can be converted into your modules for learning it will be a great step! Thanks again.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  4. #14

    Re: Further Developments in Asmosphere II

    Hi Kent,

    Yes the main problem is that hardly any of it is in standard intel x86 assembler - it is mostly a macro language and uses a library whose contents we have to guess .

    So we are immediately faced with a translation exercise.

    With Asmosphere we can leave nearly all of the i/o to thinBasic and just focus on the assembler parts - using thinBasic variable addresses to pass values back and forth:

    mov eax, [#v1]
    add eax,[#v2]
    mov [#v3],eax
    ret


    This is the simplest way to start - without using stack locals - and all variables provided by thinBasic - so they are all visible in thinBasic.

    OOP structures can also be directly mapped onto TB UDTs and arrays.

    PS:
    Curiously enough, I found it easiest to learn assembler directly from reference manuals. - the amount of supporting code required to get going makes pure assembler examples quite hard to follow.




  5. #15

    Re: Further Developments in Asmosphere II

    Quote Originally Posted by kent sarikaya
    Charles, that scares me as much as it amazes me
    Well it eliminates many of the normal constraints imposed on names. It could be used for the most fiendish obfuscation - or to bring clarity to abstract ideas with greater descriptive power.

    Modern OS'es support a wide range of file name formats to our advantage so why not try it for variable names in programs?

    Changing the fundamentals ()`"";'

    One further freedom is the ability to reassign some of the symbols on which the Asmosphere preprocessor is based. You can change the brackets, quote marks or comment marks, (And also turn case sensitivity on and off.)

    This is done with the symbols directive, which is shielded from normal parsing. The symbols directive can be invoked at any point in the program - wherever specialised syntax needs it.

    a single bracket pair ()
    3 quote marks `""
    2 comment marks ;'
    case sensitivity (c or n)

    Default configuration:

    symbols ()`"`;'n

    same but now case sensitive:

    symbols ()`"`;'c

    now using curly braces and some exotic quote marks

    symbols {}|^~;'n

    He said | she said ^ they said ~ xyz ~ ^ |

    Caveat with inline string leterals in thinBasic " and ' cannot be expressed so one must use duplicates or other symbols eg:

    symbols ()```;;n

    One further trick for those who prefer words instead of scoping brackets:

    to do this we must first dis the brackets then restore them following the macro definitions:

    symbols \\```;;n
    def begin (
    def end )
    symbols ()```;;n


    We now have the words: begin for left bracket and end for right bracket.

    mov ecx,42
    begin
    dec ecx
    jnz repeat
    end

  6. #16
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Further Developments in Asmosphere II

    Thanks for the posts. I will keep plugging away.



    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  7. #17
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Further Developments in Asmosphere II

    Found this Charles, this might be the right combination. Take a look and see what you think.
    http://www.doorknobsoft.com/tutorial...ning-assembly/
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  8. #18
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Further Developments in Asmosphere II

    make sure to go through section 2 and 3 as he does some graphics it seems.
    They could be easy to miss, as I did the first few times at the site
    http://doorknobsoft.com/tutorial/asm...sembly-part-2/
    http://doorknobsoft.com/tutorial/asm...sembly-part-3/
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  9. #19

    Re: Further Developments in Asmosphere II

    Ah yes this is 16 bit dos oriented assembler with system calls using interrupts and data segments. This CPU mode is about to disappear forever as we shift to 64 bit operating systems. Fortunately the 32 bit coding is significantly cleaner than the old stuff, and 64 bit will be a further improvement with extra registers to play with.

    To help find the right material you can use 32 bit register names as keywords when Google searching:
    eax ecx edx ebx

  10. #20
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Further Developments in Asmosphere II

    Thanks Charles, that will help by keying in with the proper search items.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Further Developments in Asmosphere III
    By Charles Pegge in forum Legacy
    Replies: 30
    Last Post: 22-09-2008, 22:55

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
  •