Menu

#15 TASM extesions for MASM compatible mode

open
nobody
None
5
2010-05-21
2010-05-21
Ykidia
No

Hello everybody!

My request is about more compatibility with TASM extensions in MASM mode. Please add this in future versions of JWASM or say how to workaround it in current version 2.02(3).

1. TASM keyword "global": if symbol exists, "global" works as "public"; if symbol does not exists, "global" works as "extern". Simple but effective.

2. Structures definition: "ends" may be prepended by structure name, or may be not, for example:
[code]
DEVDESC struc
devdesc_begin = $
DevPort dw 0
DevMask dw 0
DevSpace db 0
DevPriority db 0
DevFunction dw 0
devdesc_size = $ - devdesc_begin
ends
[/code]
Not so effective, but simple and more readable.

3. Structures definition: keyword "label" inside, for example:
[code]
; PUSHAD Workspace
PADWS struc
padws_begin = $
PADrEDIbytes label byte
PADrEDI label dword
PADrDI dw ?
dw ?
PADrESIbytes label byte
PADrESI label dword
PADrSI dw ?
dw ?
PADrEBPbytes label byte
PADrEBP label dword
PADrBP dw ?
dw ?
PADrESPbytes label byte
PADrESP label dword
PADrSP dw ?
dw ?
PADrEBXbytes label byte
PADrEBX label dword
PADrBX label word
PADrBL db ?
PADrBH db ?
dw ?
PADrEDXbytes label byte
PADrEDX label dword
PADrDX label word
PADrDL db ?
PADrDH db ?
dw ?
PADrECXbytes label byte
PADrECX label dword
PADrCX label word
PADrCL db ?
PADrCH db ?
dw ?
PADrEAXbytes label byte
PADrEAX label dword
PADrAX label word
PADrAL db ?
PADrAH db ?
dw ?
padws_size = $ - PADrEDI
ends
[/code]
Effective for me and comfortable.

That's all for now. I can send my project, which I compile with TASM and link with WLINK (for use with DOS/32A), - if needed.
Thank you.

Discussion

  • Nobody/Anonymous

    ad 1. the equivalent in MASM syntax for TASM's GLOBAL is EXTERNDEF.

    ad 2. JWasm already offers some extensions which allow to make a work-around. See this example:

    ---------------------------------
    .model small
    option casemap:none

    ;--- 1. rename keywords STRUCT and ENDS

    option renamekeyword:<struct>, struct_
    option renamekeyword:<ends>, ends_

    ;--- 2. define macros STRUCT and ENDS. The renamed
    ;--- keywords STRUCT_ and ENDS_ are used inside.

    struct macro name_:LABEL
    @CurrStruct equ <name_>
    name_ struct_
    endm

    ends macro
    @CurrStruct ends_
    endm

    ;--- 3. now STRUCT and ENDS will use the macro substitution

    DEVDESC struct
    DevPort dw ?
    ends

    .data

    v1 DEVDESC <0>

    end
    ---------------------------------

    japheth

     
  • Ykidia

    Ykidia - 2010-05-23

    Thanks, I will try it! And what about question 3?

    And another question - how to detect compiler JWASM while compilation process (for use mentioned workarounds when compiling with JWASM)? For a first time I need a code can be compiled with TASM and JWASM without code modification...

    Thank you.

     
  • japheth

    japheth - 2010-06-08

    > And another question - how to detect compiler JWASM while compilation
    > process (for use mentioned workarounds when compiling with JWASM)? For a

    It's the well documented __JWASM__ equate. Please read the documentation!

     

Log in to post a comment.