I compiled and linked, but couldn't execute.
(MASM32 editor: File/Cmd prompt)
C:\masm32>bin\ml /c test.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994
Copyright (C) Microsoft Corp 1984-1993. All rights reserved.
Run File [test.exe]:
List File [nul.map]:
Definitions File [nul.def]:
Running test.exe opens a popup "Unsupported 16-Bit Application":
The program or feature "\??\C:\masm32\test.exe" cannot start or run due
to incompatibility with 64-bit versions of Windows. Please contact the
software vendor to ask if a 64-bit Windows compatible version is available.
msg db "Enter a character: $"
assume cs:code , ds:data
mov dx, data
mov ds, dx
mov dx, offset msg
I do not know your level of assembly in 32 bits on windows.
I have written a Hello world program and can be compiled using the file build.bat of the masm32 package. May be it surprise you.
This is the code:
bbbb db "is wonderful", 0
aaaa db "Assembly",0
invoke MessageBox, NULL, addr bbbb, addr aaaa, MB_OK
invoke ExitProcess, 0
You need to understand that interrupts are forbiden and you must call windows api functions.
Registers are named preceding an "E" to the msdos part: EAX, EBX, ECX, etc.
The low word can be accessed with the msdos name. AX is the low word of EAX. And AH is the high byte of AX and AL is the low byte of AX (and of EAX).
The good news are that in the model flat all segment registers point to the same segment of 4GB. You do not need to refer to them in the most cases.
In 32 bits systems, there was emulation to 16 bits code.
In 64 bits systems, there is emulation to 32 bits code, but they do not support 16 bits programs.
If you want to know more about this emulation search in google "wow" (windows on windows).
There are three solutions:
1. You can install an emulator like VirtualBox and create a 32 bits virtual machine. To do this you need a 32 bits instalation disk. The virtual 32 bits system will emulate 16 bits machine when needed.
2. You can use an emulator to emulate a 16 bits machine. You need the instalation disks and a way to install them.
3. You use DosBox. It is the easier solution, I think.