64 bit assembler > UASM Assembler Development

UASM 2.40 release

(1/5) > >>

habran:
Hello folks,
UASM 2.40 release is out, with fixes:
   .SWITCH to allow negative and positive cases and usage of multi cases:
         .case 1, 2, 3, 4... or
         .case 1
         .case 2
         .case 3
         .case 4
   .FOR will report an error if you don't use 2 columns, this is the minimum requirement ( : : )
   
   Improved integers usage for building with different environments
   
   fixed some problem with literals in 32 bit
   
   fixed some listing issues

 check it here:     
Uasm (Site) http://www.terraspace.co.uk/uasm.html
Uasm (GitHub) https://github.com/Terraspace/UASM

jj2007:
Works fine with my big sources but it chokes with this one (an old source that built fine years ago... mystery ::)):

include \masm32\MasmBasic\Res\MbGui.asm
.data?
MyFonts         dd 4 dup(?)
.code
  mov edi, offset MyFonts
  MakeFont stosd, Height:14, "Times New Roman"
  MakeFont stosd, Height:16
  MakeFont stosd, Height:20
  MakeFont stosd, Height:24

Event Paint
  For_ ct=0 To 3
        mov ecx, ct
        GuiTextBox ct*32+7, ct*64+7, 100, 50, Str$("This is textbox #%i ", ct+1), font MyFonts[4*ecx]
  Next
GuiEnd

The issue is admittedly exotic (and there is a workaround, see attached project):

--- Code: ---include \masm32\include\masm32rt.inc

any macro arg
Local oa
  oa = opattr arg
  if oa eq 48
print "&arg is a register", 13, 10
  else
print "&arg is not a register", 13, 10
  endif
endm

.code
start:
  any eax
  any nop
  inkey "Hello World"
  exit

end start
--- End code ---

This works in UAsm and ML. This doesn't:
--- Code: ---  if (opattr arg) eq 48

--- End code ---

In short:
oa = opattr arg works with everything,
if (opattr arg) eq ... doesn't work with an "exotic" arg like nop or stosd

This is an inconsistent behaviour, btw also of Microsoft MASM. So if you decide to remain compatible, I will support your decision :lol:

IMHO if (opattr arg) should use 0 to indicate "other" if the arg doesn't fit into the immediate, mem, register etc categories, but it should never throw an error.

habran:
 :dazzled:

--- Code: --- 13120: if (opattr arg) eq 48
 13121:    nop
 13122: else
 13123:   nop
00B09838 90                   nop 
 13124:   nop
00B09839 90                   nop 
 13125: endif
--- End code ---

aw27:

--- Quote ---oa = opattr arg works with everything,

--- End quote ---
Does not work in ML and works in UASM for some unknown reason.   :shock:


--- Quote ---if (opattr arg) eq ... doesn't work with an "exotic" arg like nop or stosd

--- End quote ---

Well, we can make it work in both ML and UASM, I just don't know if this is what you want:  :icon_rolleyes:

--- Code: ---include \masm32\include\masm32rt.inc
OPTION NOKEYWORD: <nop>

any macro arg
Local oa
  ;;oa = opattr arg
  ;;if oa eq 48
  if (opattr arg)  eq 48
print "&arg is a register", 13, 10
  else
print "&arg is not a register", 13, 10
  endif
endm

.code
start:
  any eax
  any nop
  inkey "Hello World"
  exit

end start

--- End code ---


nidud:
This still crashes:

http://masm32.com/board/index.php?topic=6515.msg69952#msg69952

Crash code:

--- Code: ---cmp eax,FFFFFED5                       
jl sw_uasm.406C1A                       
cmp eax,1F3F                           
jg sw_uasm.406C1A                       
lea r10,qword ptr ds:[40C9D8]           
sub eax,FFFFFED5                       
movzx r10,word ptr ds:[r10+rax*2]       
lea rax,qword ptr ds:[408018]           
jmp qword ptr ds:[rax+r10*8]

--- End code ---

Asmc encoding using switch -swr which trashes RAX

--- Code: ---?_0001: cmp     ecx, -299
        jl      @C093B
        cmp     ecx, 7999
        jg      @C093B
        movsxd  rax, ecx
        push    rcx
        lea     rcx, [IT@C093C]
        movzx   rax, word ptr [rcx+rax*2+256H]
        lea     rcx, [@C093C]
        mov     rax, qword ptr [rcx+rax*8]
        pop     rcx
        jmp     rax

--- End code ---

And this one which worked in version 2.39 now fails:

http://masm32.com/board/index.php?topic=902.msg69672#msg69672

Navigation

[0] Message Index

[#] Next page

Go to full version