Recent Posts

Pages: 1 ... 7 8 [9] 10
81
The Workshop / Re: First post by new member
« Last post by jj2007 on May 30, 2020, 06:21:46 PM »
Yes by "verbose" I mean the .asm source syntax, not the assembler output. The full-featured assembers (a la MASM) need to define every little thing. All the .data segments, _whatever directives ... While smaller assemblers like FASM have better focus and just automatically handle all the boilerplate verbiage silently by default.

To test it, drag a text or RTF file over the exe. You can use the attached *.asc source, too, it's rtf :cool:

GuiParas equ "A full-fledged Rtf viewer in four lines", x760, y50, w500, h320, icon Tree
include \masm32\MasmBasic\Res\MbGui.asm
  GuiControl BigEdit, "richedit", wCL$()
GuiEnd
82
Mikl__'s ml64 examples / Re: OpenGL in masm64
« Last post by Mikl__ on May 30, 2020, 12:49:50 PM »
A prototype is "Spot Light" by Franck Charlet. There are asm-file, cursor and exe-file in the attachment.
83
The Workshop / Re: First post by new member
« Last post by Bilbo on May 30, 2020, 10:23:35 AM »
Hi Felipe,

Yes by "verbose" I mean the .asm source syntax, not the assembler output. The full-featured assembers (a la MASM) need to define every little thing. All the .data segments, _whatever directives ... While smaller assemblers like FASM have better focus and just automatically handle all the boilerplate verbiage silently by default. And that's great, for most of the programs one writes. Of course with the good ones you can also add more wording to override the normal settings and get exactly what you what out of it.

Thanks all for the welcome :)
84
MasmBasic & the RichMasm IDE / Start program only once
« Last post by jj2007 on May 30, 2020, 09:02:06 AM »
include \masm32\MasmBasic\MasmBasic.inc         ; Start a program just one time
  Init
  Let esi=CL$(0)                             ; use the executable name as unique string
  .if rv(GlobalFindAtom, esi)
        MsgBox 0, Cat$(esi+" is already running"), "Sorry:", MB_OK or MB_TOPMOST
  .else
        push rv(GlobalAddAtom, esi)
        MsgBox 0, Cat$(esi+" successfully started"), "Yeah:", MB_OK or MB_TOPMOST
        call GlobalDeleteAtom
  .endif
EndOfCode
85
The Soap Box / Re: Animals act better than this
« Last post by Magnum on May 30, 2020, 04:30:26 AM »
You forgot that is was a policeman that started the riot by breaking the windows of the autoshop. He was caught on camera btw.
Of course that doesn't excuse the crowd.  But does say that this was planned and they want civil unrest.

He has been charged with 3rd felony.

I feel it should be at least a 2nd degree.

We'll see what the jury decides.



86
The Soap Box / Re: Animals act better than this
« Last post by K_F on May 30, 2020, 03:54:01 AM »
Interesting interview.. very good points.

https://www.youtube.com/watch?v=JyufeHJlodE
87
The Soap Box / Re: Animals act better than this
« Last post by xanatose on May 30, 2020, 02:53:48 AM »
You forgot that is was a policeman that started the riot by breaking the windows of the autoshop. He was caught on camera btw.
Of course that doesn't excuse the crowd.  But does say that this was planned and they want civil unrest.



88
ASMC Development / Re: Object-oriented programming (OOP) in Asmc
« Last post by nidud on May 30, 2020, 02:21:32 AM »
So to continue with this construct the problem is the method selection based on arguments where multiple function share the same name. It's a difficult task, especially in assembler given registers may be used as input so you will at best be able to approximate based on count and size. Problems get solved in general by naming them so using types is the real solution here.

Types may be sorted internally by the assembler so I added a macro that names types as follows.

    typeid( [ type, ] expression )

Immediate values:

    imm_32          ?i32
    imm_64          ?i64
    imm_128         ?i128
    imm_float       ?flt

Registers:

    reg_8           ?r8
    reg_16
    reg_32
    reg_64
    reg_128
    reg_256
    reg_512

Basic types:

    mem_byte        ?byte
    mem_sbyte
    mem_word
    mem_sword
    mem_real2
    mem_dword
    mem_sdword
    mem_real4
    mem_fword
    mem_qword
    mem_sqword
    mem_real8
    mem_tbyte
    mem_real10
    mem_oword
    mem_real16
    mem_yword
    mem_zword
    mem_proc
    mem_near
    mem_far

Basic pointers:

    ptr_byte        ?pbyte
    ptr_sbyte
    ...
    ptr_far
    ptr_ptr
    ptr_void

So this will enable type-based selection.

    ostream typedef ptr
    cout    equ <ostream::>

.template ostream

    .operator ptr_sbyte :ptr sbyte {
        mov rax,_1
        }
    .operator ptr_word :ptr word {
        mov rax,_1
        }
    .operator << :abs {
        cout typeid(_1)(_1)
        }
    .ends

    cout << "Ascii string" << ( L"Unicode string" )

In the regression test the basic types are enumerated. User types expand in the same way:

types proto :vararg {
    for arg,<this>
%       echo typeid(arg)
        endm
        }

  local rc:RECT

    types( rc, addr rc )

mem_RECT
ptr_RECT

EDIT:

Optional argument.

    .operator ostream?pRECT :ptr RECT {
        mov eax,[_1].RECT.top
        }
    .operator ostream?psbyte :ptr sbyte {
        mov rax,_1
        }
    .operator ostream?pword :ptr word {
        mov rax,_1
        }
    .operator << :abs {
        cout typeid(ostream, _1)(_1)
        }

This may extend: typeid(ostream, _1)typeid(?, _2)(_1, _2)
89
Mikl__'s ml64 examples / Re: OpenGL in masm64
« Last post by Mikl__ on May 30, 2020, 02:17:19 AM »
This program shows how to draw anti-aliased lines. It draws two diagonal lines to form an X when 'r' or 'R' is typed in the window, the lines are rotated in opposite directions. A prototype is aargb.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
90
The Workshop / Re: First post by new member
« Last post by felipe on May 30, 2020, 12:32:05 AM »
Welcome bilbo  :thumbsup:

For some, the code is so verbose. For others, the code is so minimal.

The assembler should write what you wrote in the code and not to add more code than what you wrote. So what do you mean by more verbose: the style for declaring space for data, the style of the directives, things like those?  :icon_idea:
Pages: 1 ... 7 8 [9] 10