News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

CodeEdit, the New Year version

Started by HSE, January 03, 2025, 07:06:46 AM

Previous topic - Next topic

HSE

Hi all!

Here an adaptation of CodeEdit, the Middle Year Edition.

Main thing is to show macros lines numbers, because assemblers report errors inside macros in that way.

Some better behavior can be thinked, but it's no easy in a simple RichEdit without to build something similar to a line editor (how I think RadAsm and other editors have).

Any idea is welcome  :thumbsup:




Zip file contains binary and source code, additional files and tools are same from previous editions.

Regards, HSE.

Updated zip file 11/01/2025

Equations in Assembly: SmplMath

zedd151

Looks like you are overlaying the colored text over the original uncolored text, giving the appearance of doubling as they do not line up exactly.


I though that enlarging the text would help using ctrl+mouse wheel, this is the outcome:


¯\_(ツ)_/¯

HSE

Hi Zed!

Quote from: zedd151 on January 03, 2025, 07:22:28 AMoverlaying the colored text over

It's Iczelion method.

Quote from: zedd151 on January 03, 2025, 07:22:28 AMusing ctrl+mouse wheel

I never change sizes. Nice point :thumbsup:

Thanks, HSE.



Equations in Assembly: SmplMath

zedd151

Some fonts may look/work better but still use that method of overlaying the colored text...

The line numbering appears to work well, though. I haven't tested yet on very large files yet.  Maybe I can do some quick testing in a little while.

A couple minutes later:
I tested and it seems line numbers are restricted to 5 digits. But the alignment remains true otherwise.
On each 10 lines I repeated the sequence:
1...
2
3
4
5
6
7
8
9
0
copy and pasted to get a huge line count... (The embedded editor on the forum truncates the series of periods, see image there were a lot of periods to take up some width)
Over a line count of 100000:
The line number area takes up a lot of horizontal space:


After looking at your screenshot again Hector, I see that the extra space next to the source line count is reserved for macro (if used) line count?
¯\_(ツ)_/¯

fearless

Got a few crash dumps from using it, just opening it, moving around some menus, clicked on terminal icon and the window icon one which opens another instance, closed window - seemed to pause there, so could be thats when it dumped the crash log, and same with the original window when clicking the close icon - small pause, then it closed. The pauses let me to double check the crash dumps folder just to see if there was anything there, and found 4 there.

Faulting application name: CodeEdit.exe, version: 1.0.0.0, time stamp: 0x6776af1b
Faulting module name: cplugin.dll_unloaded, version: 0.0.0.0, time stamp: 0x63a400f3
Exception code: 0xc0000005
Fault offset: 0x00000000000013bd
Faulting process ID: 0xb00
Faulting application start time: 0x01db5d5ac6468c53
Faulting application path: A:\Downloads\CodeEdit_NewYear\CodeEdit.exe
Faulting module path: cplugin.dll
Report ID: fd9a84ab-4679-4beb-b3bd-281223a37437
Faulting package full name:
Faulting package-relative application ID:

zedd151

Opening a file where a macro is present, the macro line count works. (Tested on 'macros64.inc')
However if pasting a macro into the editor, the macro line count does not get updated.
It works though (macro line count), if that text is saved to a file then opened in the editor.
¯\_(ツ)_/¯

HSE

Hi Fearless and Zed!

Quote from: zedd151 on January 03, 2025, 08:55:15 AMthe macro line count does not get updated.

Now is updated when you save the file. Anyway, you have to save file previously to assembly it. The purpose is to find error lines.

The ideal could be that line numbers move whit his line when you insert something, but that need to make  things in a different way, and I don't know how (probably not so simple like this way)


Quote from: fearless on January 03, 2025, 08:34:56 AMGot a few crash dumps from using it

Fantastic. That part is Hutch's code  :biggrin:

I laugh because he could say something like: "catch exceptions is for little boys, Real Men TM must anticipate any possible error"

Because *.zip don't contain accesory files you see cplugin.dll in plugin list, but cplugin.dll it's not a plugin, that is an error Hutch don't saw :thumbsup:


Quote from: zedd151 on January 03, 2025, 08:17:32 AMOver a line count of 100000

In Masm32 SDK the file with bigger lines number is winextra.inc, wich have 25455 lines.

Hutch's idea was to build an editor skeleton to be adapted by any programmer. If you need bigger numbers just change that.

Quote from: zedd151 on January 03, 2025, 08:17:32 AMI see that the extra space next to the source line count is reserved for macro (if used) line count?

That was something secundary. Finally very easy to solve  :biggrin:

Updated a few things in first post.

Thanks, HSE.
Equations in Assembly: SmplMath

jj2007

It can quickly become complex when macros are nested...


I've chosen a slightly different approach:
- find the macro in the source, e.g. PushString MACRO
- press Ctrl O (like "change origin")
- press Ctrl G and insert the line number, now relative to the macro's first line
- hit Return to jump there

P.S., access violation for Enter 80:000000014000642D <OptionalHea | C8 8000 00                                   | enter 80,0                          |
0000000140006431              | 48:83EC 60                                   | sub rsp,60                          |
0000000140006435              | 48:8B0D 967B0000                             | mov rcx,[14000DFD2]                 | 000000014000DFD2:&"Return_App64_Path"
000000014000643C              | FF15 8E930000                                | call [<RegisterWindowMessageA>]     |

HSE

Hi JJ!

Quote from: jj2007 on January 05, 2025, 03:24:17 AMIt can quickly become complex when macros are nested...

The idea is very clear with example, perhaps must be macro expansions are nested, because with JWASM family macros (the declaration in the code) can be nested. I used nested macros but I don't remember the error output.

The nested macro declarations will crash the current parser  :biggrin:, I'm still thinking how to do that  :thumbsup:

Quote from: jj2007 on January 05, 2025, 03:24:17 AM- hit Return to jump there

Nice idea for a plugin!


Quote from: jj2007 on January 05, 2025, 03:24:17 AMP.S., access violation for Enter 80

Very interesting  :thumbsup:

Thanks, HSE.
Equations in Assembly: SmplMath

HSE

Hi all!

Quote from: zedd151 on January 03, 2025, 07:22:28 AMenlarging the text would help using ctrl+mouse wheel

That is working now.

For some sizes there is a little displacement.

Apparently I'm failing to reproduce some DrawText or DC setting, then colored text sometimes have not exactly same width than base text (¿?).

Also prevented the missing ceplugin subdirectory error (what saw Fearless).

HSE
Equations in Assembly: SmplMath

zedd151

Well, the project is getting there. Maybe ready by Christmas 2025?  I'll take a look at the latest version later.  :smiley:
¯\_(ツ)_/¯

zedd151

Original size, no magnification:
You cannot view this attachment.
Little but still noticeable misalignment.

Worst case, magnified:
You cannot view this attachment.
Terrible alignmet.

Better, magnified:
You cannot view this attachment.
Only slight misalignmenmt. But too large, imo.

It might align better with COURIER (Not Courier New) or FIXEDSYS or ms sans serif (not microsoft sans serif)??
¯\_(ツ)_/¯

HSE

Hi Zed,

Quote from: zedd151 on January 11, 2025, 06:06:43 AMnoticeable misalignment.

:biggrin: Yes, look strange.

But in 1 and 3 there is no misalignament, that is the antialiasing effect.

HSE


Equations in Assembly: SmplMath

HSE

Now read a table in size range of interest  :thumbsup:
Equations in Assembly: SmplMath

HSE

Hi all!

Quote from: jj2007 on January 05, 2025, 03:24:17 AMIt can quickly become complex when macros are nested...

Even if that refer to nested macro expansions, now parser can deal with nested macro declarations. You can build that only with JWAsm family assemblers. An example is mtx.inc file, wich contain Array macros to mimic Basic arrays.

Updated in first post.

Regards, HSE
Equations in Assembly: SmplMath