News:

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

Main Menu

Microsoft Macro Assembler Version 6.14

Started by mazu, October 21, 2019, 08:22:07 AM

Previous topic - Next topic

mazu


Hello friends

I have an application written in Borland's Turbo Assembler. I will rewrite this application in Microsoft's Macro
Assembler Version 6.14 (32 Bit Assembler in Windows 10). Which are the necessary Assembler and Linker
Options? Why the following program can't be linked correctly?

Thanks


.686

.model                     flat

$STACK                   segment use32 public
    assume               ss:$STACK
    $STACK_FIELD     db 1024 dup (00h)
$STACK                   ends

$GLOBAL                 segment use32 common
    assume               ds:$GLOBAL
    $GLOBAL_FIELD   db 80000 dup (00h)
$GLOBAL                 ends

$LOCAL                   segment use32 public
    assume               fs:$LOCAL
    $LOCAL_FIELD     db 80000 dup (00h)
$LOCAL                   ends

$SPECIAL                segment use32 common
    assume               gs:$SPECIAL
    $SPECIAL_FIELD  db 80000 dup (00h)
$SPECIAL                ends

$CODE                    segment use32 public
    assume               cs:$CODE
    $ENTRY:
    mov                    ax,$STACK
    mov                    ss,ax
    mov                    ax,$GLOBAL
    mov                    ds,ax
    mov                    ax,$LOCAL
    mov                    fs,ax
    mov                    ax,$SPECIAL
    mov                    gs,ax
    mov                    esp,1024
    mov                    al,00h
    mov                    ah,04Ch
    int                       021h
$CODE                     ends

end                         $ENTRY


Microsoft (R) Macro Assembler Version 6.14.8444
ML.EXE /c /Fo%1.OBJ /Fl%1.LST %1.ASM
0 Warnings  0 Errors

Microsoft (R) Incremental Linker Version 5.12.8078
LINK.EXE /OUT:%1.EXE /MAP:%1.MAP %1.OBJ
LINK : error : Segment reference in fixup record
fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

hutch--

Your code is 16 bit real mode code complete with DOS interrupts, it absolutely will not run in protected mode Win32.