flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
Crukko 11 Feb 2006, 07:02
Hi Guys
![]() Only for test.....and comment! As you can see is the 0.01! So Bugs, features and so on still in progress...but there are my ideas ![]() Let me know your comment, ok ? Madis731: see the WinConverter in the utility menu....do you like it? ![]() Features: 1) Set and Goto Did you ever needed to port some code from line 10.000 to line 100 and you jump by up e down cursor? Now it's more simple ![]() 2) Navigate Now you can jump to the part of code you need (recognized only proc e label) 3) Comment and Uncomment Block Did you ever needed to exclude a big part of code for testing something, and than to get back? eheheh 4) Fasm Syntax now is going to recognize fasm command (invoke, stdcall, etc) and do something. For now only paint ProcName with different color) Remember! still in progress!
|
|||||||||||
![]() |
|
Crukko 11 Feb 2006, 07:17
Post Script!
It seems autocompletition is possible in FasmW by fasm syntax routine.....or not ![]() |
|||
![]() |
|
Crukko 11 Feb 2006, 07:41
Yes, code completition.
This feature is possible by indexed memory I got in my code.....and use less memory you can image... thx ![]() Sincerely I started developping FasmWNG thanks to Fresh ![]() I hope helping you, but I need some help too for understanding Fresh code ![]() Best Regard. |
|||
![]() |
|
Crukko 11 Feb 2006, 07:45
P.S.
How Fresh get information for the code completition? In FasmWNG only on source load (for now ![]() I think the future is also to scan files when 'include' in typed for equ, struct, and so on...... |
|||
![]() |
|
Crukko 11 Feb 2006, 07:57
feature after source loaded:
5) in WinList you'll find definition recognized (for now ![]() 6) in WinConvert, if in source there are 'equ' you can obtain the value. Example: A equ 5 if you type A in the 'Exp' tag of WinConverter you obtain the result ![]() and if you type A+A*A/A????? ![]() note: a is different tha A!!!! |
|||
![]() |
|
Madis731 11 Feb 2006, 08:21
Here's what I've got, I tried testing, but it kept crashing:
1) Converter doesn't do anything...yet? Crashes when pressing enter 2) Closing WinList closes the program 3) Escape doesn't close the active tab like in FASMW 4) Comment block crashes 5) Win.out it out ![]() 6) Win.out doesn't show anything reasonable...yet? 7) Win.out should make use of a close-button. Its not good to use Alt+F4 ![]() 9) Default font is too small Do you need any help translating? I saw that some part are in different language. |
|||
![]() |
|
Crukko 11 Feb 2006, 09:08
1) really strange! I tested now too. it works....what os do you have?
2) yes, i know ![]() ![]() 3) the escape can't close by my intention! use ALT + C = Close src instead. 4) tested comment....it works on my pc......uhmmm...suggestion? 5) I use 1440x900...sorry ![]() 6) yet! if you load a source with 'equ' or 'struct' definition you will see something.....work in progress!!!! 7) no close butto because you can use the menu! for now it came on when you open the prg...in the future it will be optional. ![]() Example: Root label (proc) ----underlabel1 ----underlabel2 --------.label --------.label2 ----enderlabel_n untill endp label (new proc or other) pls try again winconverter and let me know....[/img] |
|||
![]() |
|
decard 11 Feb 2006, 09:37
Code completion (CC) in Fresh uses symbols defined in source. So if you have "my_label" defined, you can access it in CC list (by pressing ctrl+space). This list isn't available before first compilation (it must go through assembling without errors).
To see how it internally works, take a look at fasm.asm labelslist.asm and from Fresh/Source directory. But wait till this evening or tomorrow morning, because then I'm going to upload new version where gathering symbols in implemented in different way, and should be easier to understand. |
|||
![]() |
|
Crukko 11 Feb 2006, 09:57
decard: ok...
i think is possible to update the CC while you're writing source....before ypu need to compile.... my test on this will be afer some bugfix....I'll let you know.... did you have the same problem of Madis731? |
|||
![]() |
|
decard 11 Feb 2006, 10:43
Crukko wrote: i think is possible to update the CC while you're writing source....before ypu need to compile.... Yes it would be possible. I'm thinking about compiling source in the background while user is typing the code but I don't know precisely how it could work (what about errors? if there was any typo, copliation would fail and list couldn't be generated). I heard that Delphi works this way... but I don;t know how exactely... |
|||
![]() |
|
Crukko 11 Feb 2006, 11:12
compiling while writing? I did it already!
start d.exe and try to type a label: as you can see after the ':' FasmWNG recognize the label! Also 'proc' works! try to type this line: proc test Arg1, Arg2 as you can see, after 'proc' the nameproc is recognized and painted with different colour, then param are treated normally The only thing isn't in the code (yet!) is the compilig ..... as I do on load source. pls decard: do you have the same problem of Madis731? |
|||
![]() |
|
decard 12 Feb 2006, 10:27
you mean conventer crashing? well it does not crash on my system.
well, by compiling I mean compiling by fasm ![]() BTW, how did you implemented expression parser? |
|||
![]() |
|
Crukko 12 Feb 2006, 22:09
what did you mean for 'expression parser'?
1) a+a/a..... 2) instruction recognition while typing.... For 'compiling' I mean a future evolution of FasmWNG: compiling source while writing it and the possibility to start program and track step by step the instruction ![]() eheheh.....i'm on the right way (I think!) but time needed! Madis731: do you have still problem? |
|||
![]() |
|
Crukko 12 Feb 2006, 22:16
For WinConverter: did you try these:
1 + 2 & 1 or 5 not 1 or (((1+1)*2)/4)^1 ![]() |
|||
![]() |
|
decard 12 Feb 2006, 22:22
by espression parser I mean 'a+a/a' of course
![]() How are you calculating this? Using RPN? |
|||
![]() |
|
Crukko 13 Feb 2006, 00:50
RPN ??? What is this?
Here you are the code ![]() I'm doing a 'cut&paste' ....Sorry...there can be some internal routine I wrote....if so, ask me, ok? Code: proc _ValoreEspressione, Sorg, Indice, Routine pusha stdcall _Repeat, 0, Temp_sviluppo, __Byte, NULL, 256 stdcall _Repeat, 0, Temp_operatori, __Byte, NULL, 256 stdcall _Repeat, 0, Temp_valori, __Byte, NULL, 256 mov [Value_tonda_flag], dword 0 mov [Value_pos_flag], -1 mov [Value_pri_flag], -1 mov [Flag_errore], 0 mov esi, [Sorg] mov edi, Temp_sviluppo mov ecx, Temp_operatori xor eax, eax ;----------------------- .loopcompilaespressione: ;----------------------- lodsb or al, al jnz .salto jmp .finecompilazione .salto: cmp al, '(' jne .salto1 jmp .apriparentesi .salto1: cmp al, ')' jne .salto2 jmp .chiudiparentesi .salto2: cmp al, '^' jne .salto3 mov dl, 2 jmp .priorita ; jmp .priorita2 .salto3: cmp al, '*' jne .salto4 mov dl, 1 jmp .priorita ; jmp .priorita1 .salto4: cmp al, '/' jne .salto5 mov dl, 1 jmp .priorita ; jmp .priorita1 .salto5: cmp al, '+' jne .salto6 jmp .priorita0 .salto6: cmp al, '-' jne .salto7 jmp .priorita0 .salto7: cmp al, '|' jne .salto8 mov dl, 3 jmp .priorita ; jmp .or .salto8: cmp al, '&' jne .salto9 mov dl, 3 jmp .priorita ; jmp .and .salto9: cmp al, '!' jne .salto10 mov dl, 5 jmp .priorita ; jmp .not .salto10: cmp al, "'" jne .salto11 mov dl, 3 jmp .priorita ; jmp .xor .salto11: cmp al, "<" jne .salto12 mov dl, 4 jmp .priorita ; jmp .shl .salto12: cmp al, ">" jne .salto13 mov dl, 4 jmp .priorita ; jmp .shr .salto13: cmp al, 32 jne .salto14 jmp .loopcompilaespressione .salto14: cmp al, 9 jne .salto15 jmp .loopcompilaespressione .salto15: mov edx, Temp_valori .loopcopiavalore: mov [edx], al inc edx lodsb or al, al jz .finecopiavalore cmp al, '(' je .finecopiavalore cmp al, ')' je .finecopiavalore cmp al, '-' je .finecopiavalore cmp al, '+' je .finecopiavalore cmp al, '*' je .finecopiavalore cmp al, '/' je .finecopiavalore cmp al, '^' je .finecopiavalore cmp al, '<' je .finecopiavalore cmp al, '>' je .finecopiavalore cmp al, '!' je .finecopiavalore cmp al, "'" je .finecopiavalore cmp al, '|' je .finecopiavalore cmp al, '&' je .finecopiavalore cmp al, 32 je .finecopiavalore cmp al, 9 je .finecopiavalore jmp .loopcopiavalore .finecopiavalore: dec esi mov [edx], byte 0 mov eax, dword [Temp_valori] and eax, 0FFFFFFh cmp eax, 'and' je .saltoand cmp eax, 'AND' je .saltoand cmp eax, 'And' je .saltoand cmp eax, 'or' je .saltoor cmp eax, 'OR' je .saltoor cmp eax, 'Or' je .saltoor cmp eax, 'xor' je .saltoxor cmp eax, 'XOR' je .saltoxor cmp eax, 'Xor' je .saltoxor cmp eax, 'not' je .saltonot cmp eax, 'NOT' je .saltonot cmp eax, 'Not' je .saltonot stdcall _Match, [Indice], Temp_valori, 0, 0, 1, 0 cmp [Flag_errore], 1 jne .cont_postmatch cmp [Routine], dword 0 je .cont_postmatch mov eax, [Routine] stdcall eax, [Indice], [Valore] cmp [Flag_errore], -1 je .cont_postmatch jmp .valoreok .cont_postmatch: ;=================================================== stdcall _Val, Temp_valori cmp [Flag_errore], 0 je .valoreok mov [Flag_errore], -3 jmp .errore .valoreok: mov al, 'v' stosb mov eax, [Valore] stosd mov [Value_pos_flag], 0 jmp .loopcompilaespressione ;-------------- .saltoand: ;-------------- mov eax, '&' jmp .salto ;-------------- .saltoor: ;-------------- mov eax, '|' jmp .salto ;-------------- .saltoxor: ;-------------- mov eax, "'" jmp .salto ;-------------- .saltonot: ;-------------- mov eax, '!' jmp .salto ;-------------- .errore: ;-------------- sub esi, [Sorg] mov [Valore], esi jmp .fine ;-------------- - .priorita0: ;-------------- - cmp [Value_pos_flag], 0 je .saltopri0 cmp [Value_pos_flag], 3 je .saltopri0 cmp [Value_pos_flag], -1 je .saltoprepri0 mov [Flag_errore], -1 jmp .errore .saltoprepri0: cmp al, '-' jne .loopcompilaespressione push ax mov al, 'v' stosb mov al, 0 stosd pop ax .saltopri0: mov edx, Temp_operatori cmp ecx, edx je .contpri0 call popoperatori .contpri0: call pushoperatore mov [Value_pri_flag], 0 mov [Value_pos_flag], 1 jmp .loopcompilaespressione ;-------------- - .priorita: ;-------------- - push dx call checkopok cmp [Flag_errore], -1 jne .cnt_pri pop dx jmp .errore .cnt_pri: cmp [Value_pri_flag], dl jb .pushpri1 call popoperatori .pushpri1: call pushoperatore .finepri1: pop dx mov [Value_pri_flag], dl mov [Value_pos_flag], 1 jmp .loopcompilaespressione ;-------------- .apriparentesi: ;-------------- cmp [Value_pos_flag], -1 je .saltoapriparentesi cmp [Value_pos_flag], 1 je .saltoapriparentesi mov [Flag_errore], -1 jmp .errore .saltoapriparentesi: inc [Value_tonda_flag] call pushoperatore mov [Value_pri_flag], -1 mov [Value_pos_flag], 2 jmp .loopcompilaespressione ;---------------- .chiudiparentesi: ;---------------- cmp [Value_pos_flag], 0 je .saltochiudiparentesi mov [Flag_errore], -1 jmp .errore .saltochiudiparentesi: cmp [Value_tonda_flag], 0 ja .saltochiudiparentesi1 mov [Flag_errore], -2 jmp .errore .saltochiudiparentesi1: dec [Value_tonda_flag] mov [Value_pos_flag], 3 call popoperatori jmp .loopcompilaespressione ;---------------- .finecompilazione: ;---------------- call popoperatori mov esi, Temp_sviluppo mov edi, Temp_operatori .loopfinecompilazione: lodsb or al, al jnz .contloopfinecompilazione mov [Flag_errore], 1 jmp .fine .contloopfinecompilazione: cmp al, 'v' jne .operatore jmp .valore .operatore: lodsd cmp al, '+' je .addizione cmp al, '-' je .sottrazione cmp al, '*' je .moltiplicazione cmp al, '/' je .divisione cmp al, '^' je .potenza cmp al, '&' je .and cmp al, '|' je .or cmp al, "'" je .xor cmp al, '!' je .not cmp al, '<' je .shl cmp al, '>' je .shr .valore: lodsd stosd jmp .loopfinecompilazione .addizione: mov eax, [edi - 4] add eax, [edi - 8] sub edi, 8 stosd jmp .loopfinecompilazione .sottrazione: mov eax, [edi - 8] sub eax, [edi - 4] sub edi, 8 stosd jmp .loopfinecompilazione .moltiplicazione: mov eax, [edi - 4] xor edx, edx mov ebx, [edi - 8] mul ebx sub edi, 8 stosd jmp .loopfinecompilazione .divisione: mov eax, [edi - 8] xor edx, edx mov ebx, [edi - 4] div ebx sub edi, 8 stosd jmp .loopfinecompilazione .potenza: mov eax, [edi - 8] mov ebx, eax mov ecx, [edi - 4] cmp ecx, 0 jne .saltopotenza mov eax, 1 jmp .finepotenza .saltopotenza: cmp ecx, 1 jne .sviluppopotenza jmp .finepotenza .sviluppopotenza: dec ecx .looppotenza: mul ebx loopne .looppotenza .finepotenza: sub edi, 8 stosd jmp .loopfinecompilazione .and: mov eax, [edi - 8] and eax, [edi - 4] sub edi, 8 stosd jmp .loopfinecompilazione .or: mov eax, [edi - 8] or eax, [edi - 4] sub edi, 8 stosd jmp .loopfinecompilazione .xor: mov eax, [edi - 8] xor eax, [edi - 4] sub edi, 8 stosd jmp .loopfinecompilazione .not: mov eax, [edi - 4] not eax sub edi, 4 stosd jmp .loopfinecompilazione .shl: mov eax, [edi - 8] mov ecx, [edi - 4] shl eax, cl sub edi, 8 stosd jmp .loopfinecompilazione .shr: mov eax, [edi - 8] mov ecx, [edi - 4] shr eax, cl sub edi, 8 stosd jmp .loopfinecompilazione .fine: mov eax, [edi - 4] mov [Valore], eax ; - - - - - - - - - - - - - - - - - - - - - - - - - - - popa ret endp ; - - - - - - - - - - - - - - - - - - - - - - - - - - - ;-------------- checkopok: ;-------------- cmp [Value_pos_flag], 0 je .bene cmp [Value_pos_flag], 3 je .bene mov [Flag_errore], -1 .bene: ret ;-------------- pushoperatore: ;-------------- mov [ecx], al mov al, [Value_pri_flag] mov [ecx + 1], al add ecx, 2 ret ;-------------- popoperatori: ;-------------- push ax mov edx, Temp_operatori .looppopoperatori: cmp edx, ecx je .finepopoperatori sub ecx, 2 mov al, [ecx + 1] mov [Value_pri_flag], al mov al, [ecx] cmp al, '(' jne .saltopopoperatori cmp [Value_pos_flag], 3 jne .saltopopoperatori1 jmp .finepopoperatori .saltopopoperatori1: add ecx, 2 ; mov [Value_pri_flag], -1 jmp .finepopoperatori .saltopopoperatori: push ax mov al, 'o' stosb pop ax stosd jmp .looppopoperatori .finepopoperatori: pop ax ret ; - - - - - - - - - - - - - - - - - - - - - - - - - - - Last edited by Crukko on 13 Feb 2006, 00:55; edited 1 time in total |
|||
![]() |
|
Crukko 13 Feb 2006, 00:53
Sorg = pointer to an ASCII Null Terminated String with expression
Indice = pointer to indexed memory(array) where there are definition Routine = pointer to the external routine which return the value of the definition |
|||
![]() |
|
Crukko 13 Feb 2006, 04:32
decard:
If I want to know the position in screen-pixel of the cursor? How can I do? My intention is to open a window with no border under the line I'm typing in to show the possible command/equ/ecc (right, code completition ![]() |
|||
![]() |
|
decard 13 Feb 2006, 07:39
RPN, is "reverse polish notation", check it at Wikipedia if you want to know more about it. Converting expression to RPN first seems to be prefered way of parsing them (I was interested int this topic some time ago and usually found this when googling).
Crukko wrote: If I want to know the position in screen-pixel of the cursor? How can I do? In Fresh it is done by sending AEM_GETCARETXY message to control. It is not available in standard control, but you can add it to asmedit.inc: Code: ; AEM_GETCARETXY message handler aem_getcaretxy: mov ecx, [wparam] mov eax,[caret_y] mov ebx,[caret_x] mov [ecx+AECARETXY.x0], ebx mov [ecx+AECARETXY.x1], ebx mov [ecx+AECARETXY.y0], eax add eax,[font_height] mov [ecx+AECARETXY.y1], eax jmp .ignore Code: ; you will also need AECARETXY structure: struct AECARETXY x0 dd ? y0 dd ? x1 dd ? y1 dd ? ends usage: Code: local caret AECARETXY lea eax, [caret] invoke SendMessage, [aedit], AEM_GETCARETXY, eax, 0 However you can't just display CC list at caret position. You should meke sure that whole list is visible (within screen resolution). Take a look at \source\sourceeditor.asm from Fresh. At line 639 you have UpdateCCPosition function that is responsible for this. regards, Mateusz |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.