Click here to Skip to main content
15,178,202 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm completely new to assembly and I'm using emu8086 to create my projects, I compiled my project to exe but when i tried to run it there was a message telling it cannot run under 64 bit windows.
How can I make a project run under 64 bit? Am I have to change my codes or assembly that I'm using?

this is the code I used:
; multi-segment executable file template.

data segment
    ; add your data here!
    pkey db "press any key...$"

stack segment
    dw   128  dup(0)

code segment
; set segment registers:
    mov ax, data
    mov ds, ax
    mov es, ax

    mov ah, 0eh
    mov al,'M'
    int 10h

    lea dx, pkey
    mov ah, 9
    int 21h        ; output string at ds:dx

    ; wait for any key....
    mov ah, 1
    int 21h

    mov ax, 4c00h ; exit to operating system.
    int 21h

end start ; set entry point and stop the assembler.


1 solution

This is old style 16-bit DOS code and will not run in a protected system. If you are running it within an emulator then check the emulator documentation for rules and restrictions.
mehdi_k 3-Nov-11 13:13pm
It work in emulator but I want it to run after I compile it to exe, how can I do that?
Richard MacCutchan 3-Nov-11 13:31pm
Try compatibility mode. Right click the executable file and select Properties and then Compatibility. See if one of the earlier versions of Windows will do it.
mehdi_k 4-Nov-11 4:32am
It wont work again, I think it's a 16 bit program, and it will not work even on 32 bit, what should I do, Skipping assembly and work with c# maybe :D
Richard MacCutchan 4-Nov-11 5:33am
I know it's a 16 bit program, as I explained above. I have no idea why you or anyone would be trying to run such ancient code on a modern Windows system, I was just offering suggestions as to how it might work. As to what you should do next, I have no idea, it all depends on what you are trying to achieve.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900