Author Topic: UASM 2.51  (Read 1824 times)

johnsa

  • Member
  • ****
  • Posts: 838
    • Uasm
UASM 2.51
« on: March 01, 2021, 01:14:16 AM »
Hi all,

I've updated the git repo, new branch v2.51 and the binaries are on the site for Windows 32bit and 64bit.

Not too much change this release, just rolling up what should have been in 2.50 +
1. Removed option zerolocals totally, it's silly and wasn't implemented fully.
2. Added a warning if win64 options automatically change the stackbase from rbp to rsp (that had caught me out once or twice)
3. Moved some more instructions into codegen v2
4. Some more cleanup and refactoring
5. A data declaration in a proc is now generated AFTER the prologue.. for some reason before hand due to the parser ordering it would put it before the prologue (This was at the request of Vid512).
6. The biggest one, with huge thanks to Nidud for his input, I've added in CV5 / CV8 debug support and followed Nidud's lead.. cmd line switches -Zi5 or -Zi8

I still have very little time for Uasm these days, but am trying to keep it from rotting.. If anyone has the time/will to contribute it would be hugely appreciated.

Thanks!
John

TouEnMasm

  • Member
  • *****
  • Posts: 1615
    • EditMasm
Re: UASM 2.51
« Reply #1 on: March 01, 2021, 02:33:38 AM »
 :thumbsup:
Trying to compile the source with VS 2019 I get
Quote
\UASM-master\x86macros.c(317,41): error C2065: 'LANG_REGCALL' : identificateur not declared
Any help ?
Fa is a musical note to play with CL

jimg

  • Member
  • ***
  • Posts: 466
Re: UASM 2.51
« Reply #2 on: March 01, 2021, 03:06:16 AM »
When I try to download 2.51 from the link on the site, it gives me http://www.terraspace.co.uk/uasm249_x64.zip, you have to manually change the link to http://www.terraspace.co.uk/uasm251_x64.zip

jj2007

  • Member
  • *****
  • Posts: 11308
  • Assembler is fun ;-)
    • MasmBasic
Re: UASM 2.51
« Reply #3 on: March 01, 2021, 03:26:02 AM »
Thanks, John - so far it works fine with my fat sources, with one minor hickup in 22+42=64kLines of code:
Code: [Select]
include \masm32\include\masm32rt.inc

buffersize=4000
.data
somedd1 dd 3839
somedd2 dd 3840

.code
start:
  cls
  movsx eax, sbyte ptr somedd1[1]
  print str$(eax), " for sbyte ptr somedd1[1]", 13, 10
  print str$(buffersize/256-255), " for buffersize/256-255", 13, 10
  .if sbyte ptr somedd1[1]<buffersize/256-255
print "dd1 ok", 13, 10
  .else
print "dd1 too big", 13, 10
  .endif
  .if sbyte ptr somedd2[1]<buffersize/256-255
print "dd2 ok", 13, 10
  .else
print "dd2 too big", 13, 10
  .endif
  exit

end start

This assembles fine with the June 2019 version (and Masm, AsmC) but throws an error in UAsm 2.51. I guess it should throw an error, given that buffersize/256-255 = -240 (which gets translated to +16 by Masm, so it most probably means I had a little bug in my code for the last 3 years or so - I expected a positive number). There might be scenarios where -240 is ok for a comparison.

Btw UAsm has become a little bit faster - congrats :thup:
« Last Edit: March 01, 2021, 08:38:38 AM by jj2007 »

johnsa

  • Member
  • ****
  • Posts: 838
    • Uasm
Re: UASM 2.51
« Reply #4 on: March 01, 2021, 05:58:07 AM »
Doh... link fixed .. it's been so long since I did an update I've forgotten how haha ;)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8235
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: UASM 2.51
« Reply #5 on: March 04, 2021, 05:11:31 AM »
Come on guys, John has done great work with UASM but he needs some support in keeping UASM going. If you don't want UASM to fade away, assist with source, write some decent libraries and help out with the support files and you will ensure that it remains available for the many people who need an alternative to Microsoft.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

LiaoMi

  • Member
  • ****
  • Posts: 797
Re: UASM 2.51
« Reply #6 on: March 04, 2021, 07:26:50 AM »
Hi johnsa,

old bug still exists  :arrow_down:

Code: [Select]
OPTION FLAT:1

includelib c:\masm32\lib\msvcrt.lib
printf proto C :ptr, :vararg

.data
msg32 db "Hello from 32 bit!", 10,0

.code

mainCRTStartup proc C
push eax
push edx
push offset msg32
call printf
add esp, 12
ret
mainCRTStartup endp

end

Code: [Select]
UASM v2.51, Feb 27 2021, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

mywindow2Bug.asm : Error A2197: Unknown fixup type: 9 at .debug$S.19D
mywindow2Bug.asm : Error A2197: Unknown fixup type: 9 at .debug$S.1FE
mywindow2Bug.asm: 28 lines, 2 passes, 2 ms, 0 warnings, 2 errors

Code: [Select]
Starting pass 1
mywindow2Bug.obj : fatal error LNK1190: invalid fixup found, type 0x0001

Quote
I still have very little time for Uasm these days, but am trying to keep it from rotting.. If anyone has the time/will to contribute it would be hugely appreciated.
To contribute, we need to know exactly where to start, it would be nice to have a small tutorial, which describes how to transfer instructions into codegen v2.

Thank you John for your hard work! Thanks Nidud for the updated debug format CV8!

jj2007

  • Member
  • *****
  • Posts: 11308
  • Assembler is fun ;-)
    • MasmBasic
Re: UASM 2.51
« Reply #7 on: March 04, 2021, 09:19:41 AM »
Thank you John for your hard work! Thanks Nidud for the updated debug format CV8!

I echo that :thumbsup:

It would be even better if Hutch' precious efforts could be used with UAsm and AsmC :cool:

I would be interested to see if Japheth's JWASM could be used with the libraries and includes that I already have using the macros I have done but it would still require some of Vasily's macros and I gather that JWASM may not run them properly.

it would still require some of Vasily's macros

It would require disabling the .if, invoke etc macros with e.g. IFIDNI @Assembler, <ML> then .if macro ...

Perhaps like this:
Code: [Select]
IFIDNI @Assembler, <ML>
  include VasilysMacros4ML64.inc   ; invoke, if else endif, repeat ... until, while ... wend, switch .. case .. endsw
ENDIF
include Macros4allAssemblers.inc

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8235
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: UASM 2.51
« Reply #8 on: March 04, 2021, 11:08:34 AM »
JJ,

You had a forlorn hope there of crippling MASM to fit into the sphere of Watcom derivatives. I posted here because it does not seem that John is getting enough support to keep UASM going and that would be unfortunate as it serves the interests of folks who don't want to use Microsoft tools.

Now surely there must be at least some of the UASM followers that could write library modules, provide some decent documentation, come up with some code designs or even help out with the source code. If a community was to develop, it would share the load around and ensure that the project survived.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 11308
  • Assembler is fun ;-)
    • MasmBasic
Re: UASM 2.51
« Reply #9 on: March 04, 2021, 12:31:46 PM »
You had a forlorn hope there of crippling MASM

No, I never had the intention to cripple MASM. Actually, my 64-bit code does build with ML64.exe :cool:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8235
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: UASM 2.51
« Reply #10 on: March 04, 2021, 10:45:46 PM »
 :biggrin:

I wonder why you keep trying to change the subject about helping John out when you have been flogging the virtues of UASM for such a long time while having criticised MASM for a very long time. If the faithful who have been waxing lyrical about the virtues of UASM actually formed a community to support UASM, it could become a force to be reckoned with.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

TouEnMasm

  • Member
  • *****
  • Posts: 1615
    • EditMasm
Re: UASM 2.51
« Reply #11 on: March 05, 2021, 12:52:20 AM »
  old bug steel exists ???
Quote
mainCRTStartup proc C
   push eax
   push edx
   push offset msg32
   call printf
   add esp, 12                                              <<<< here is an epilogue who is not needed with uasm (he do it itself)
   ret
mainCRTStartup endp
Fa is a musical note to play with CL

LiaoMi

  • Member
  • ****
  • Posts: 797
Re: UASM 2.51
« Reply #12 on: March 05, 2021, 03:07:37 AM »
  old bug steel exists ???
Quote
mainCRTStartup proc C
   push eax
   push edx
   push offset msg32
   call printf
   add esp, 12                                              <<<< here is an epilogue who is not needed with uasm (he do it itself)
   ret
mainCRTStartup endp

Hi TouEnMasm,

it doesn't change anything, the code is not going to be built  :sad:
Code: [Select]
%UASM%\UASM64 /c /coff /Cp -Zp8 /Cu /nologo /W2 -Zi0 -Zi1 -Zi2 -Zi3 -Zi5 -Zi8 /Zd -Zf %appname%.asm >> %appname%_%stamp%.assemblylog.txt

johnsa

  • Member
  • ****
  • Posts: 838
    • Uasm
Re: UASM 2.51
« Reply #13 on: March 05, 2021, 06:15:28 AM »
Hi johnsa,

old bug still exists  :arrow_down:

Code: [Select]
OPTION FLAT:1

includelib c:\masm32\lib\msvcrt.lib
printf proto C :ptr, :vararg

.data
msg32 db "Hello from 32 bit!", 10,0

.code

mainCRTStartup proc C
push eax
push edx
push offset msg32
call printf
add esp, 12
ret
mainCRTStartup endp

end

Code: [Select]
UASM v2.51, Feb 27 2021, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

mywindow2Bug.asm : Error A2197: Unknown fixup type: 9 at .debug$S.19D
mywindow2Bug.asm : Error A2197: Unknown fixup type: 9 at .debug$S.1FE
mywindow2Bug.asm: 28 lines, 2 passes, 2 ms, 0 warnings, 2 errors

Code: [Select]
Starting pass 1
mywindow2Bug.obj : fatal error LNK1190: invalid fixup found, type 0x0001

Quote
I still have very little time for Uasm these days, but am trying to keep it from rotting.. If anyone has the time/will to contribute it would be hugely appreciated.
To contribute, we need to know exactly where to start, it would be nice to have a small tutorial, which describes how to transfer instructions into codegen v2.

Thank you John for your hard work! Thanks Nidud for the updated debug format CV8!

I don't think the purpose of option flat is understood here, it should only be used with .BIN output not OBJ. It does not write debug info or generate anything linkable. It's for use when you need to write out sections exactly as is in a way compatible with bootloaders etc. What were you expecting OPTION FLAT to do for you and maybe there are better options to set?

LiaoMi

  • Member
  • ****
  • Posts: 797
Re: UASM 2.51
« Reply #14 on: March 05, 2021, 06:51:23 AM »
Hi johnsa,

old bug still exists  :arrow_down:

Code: [Select]
OPTION FLAT:1

includelib c:\masm32\lib\msvcrt.lib
printf proto C :ptr, :vararg

.data
msg32 db "Hello from 32 bit!", 10,0

.code

mainCRTStartup proc C
push eax
push edx
push offset msg32
call printf
add esp, 12
ret
mainCRTStartup endp

end

Code: [Select]
UASM v2.51, Feb 27 2021, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

mywindow2Bug.asm : Error A2197: Unknown fixup type: 9 at .debug$S.19D
mywindow2Bug.asm : Error A2197: Unknown fixup type: 9 at .debug$S.1FE
mywindow2Bug.asm: 28 lines, 2 passes, 2 ms, 0 warnings, 2 errors

Code: [Select]
Starting pass 1
mywindow2Bug.obj : fatal error LNK1190: invalid fixup found, type 0x0001

Quote
I still have very little time for Uasm these days, but am trying to keep it from rotting.. If anyone has the time/will to contribute it would be hugely appreciated.
To contribute, we need to know exactly where to start, it would be nice to have a small tutorial, which describes how to transfer instructions into codegen v2.

Thank you John for your hard work! Thanks Nidud for the updated debug format CV8!

I don't think the purpose of option flat is understood here, it should only be used with .BIN output not OBJ. It does not write debug info or generate anything linkable. It's for use when you need to write out sections exactly as is in a way compatible with bootloaders etc. What were you expecting OPTION FLAT to do for you and maybe there are better options to set?

Thank you, everything is clear, it looks logical. The example is taken from here - http://masm32.com/board/index.php?topic=7900.msg86586#msg86586, the goal was to have debug symbols for mixed mode. But in mixed mode, even the debugger does not always work correctly.