UASM icon indicating copy to clipboard operation
UASM copied to clipboard

Operations on RECORDs inconsistent with MASM

Open 640-KB opened this issue 1 month ago • 1 comments

I'm working on a fairly large project written entirely for MASM and looking for a modern alternative assembler to recommend. UASM looks great, though there are a few issues with behavior that isn't consistent with MASM.

Notably, it will not allow any type of operations within or after an inline RECORD literal definition. For example,

DBW		RECORD	hibyte:8, lobyte:8
COLOR 	RECORD  	blink:1, back:3, intense:1, fore:3

    mov  ax, DBW < 0AH, ' ' >		 ; fails with Error A2065: Constant expected
    mov  ax, ( DBW < 0AH, 20H > )    ; fails with Error A2151: Missing operator in expression
    mov  ax, DBW < 0AH, 20H > + 1    ; fails with Error A2210: Syntax error: + 1
    mov  al, high DBW < 0AH, 20H >   ; fails with Error A2151: Missing operator in expression
    mov  ax, DBW < COLOR<>, 12H >    ; fails with Error A2210: Syntax error:   , 10h 

All of these are valid and work on MASM 5.x, 6.x and TASM 3.

This is using UASM v2.57, Aug 9 2024, uasm64 for Windows.

Thanks!

640-KB avatar Nov 23 '25 01:11 640-KB

I've fixed the first example from this in 2.58 branch, RECORDS in JWASM/UASM really don't look all that MASM compatible imo - I never use them I have to say so not something I've ever run into. It looks like the whole evaluation and expansion of RECORD types needs to be redone at some point so that it evaluates to a final constant, then gets re-processed as part of the expanded line ie

mov ax, DBW <0ah,20h>+1 should become mov ax, 0a20h+1 ; this happens < but this is where it stops, and the line isn't valid for codegen, it needs another / 2nd pass.

john-terraspace avatar Nov 28 '25 21:11 john-terraspace