Subject changelog
Beginner...Masm64 new install Richard-001.asm
Beginner...Masm64 new install VIRUS ???? (not a virus)...Richard-001.asm
Beginner...Masm64 new install VIRUS ???? (RESOLVED - not a virus)
Masm64 new install VIRUS ???? (RESOLVED - not a virus)
Masm64 new install VIRUS ????
Some advice please re info as per attachment below...
You can be certain there are no viral code in the zip file. I had a look at the PNG file and it is squarking at any EXE file and this is a setting that is designed for non technical users. Change your settings in the default AV scanner. Once you have it unzipped, check the source code, build the examples and run them through JOTTI.
There is not much I can do about false positives from AV scanners, to construct programming material of this type, you must have executable files to do it.
@hutch--
Thanks for reply.
The Anti Virus software is WINDOWS 10 x64 Defender and I have no clue how to disable it. However I "cheated" and used an old MAC with High Seira installed and downloaded the zip (no problems there) and on the MAC I also had 7ZIP EQUIVALENT installed and unzipped on the MAC (no problems there) and then copied the files onto an exFAT USB stick (initially a problem, did the copy again and no problems there).
The usb stick was plugged into the PC and files copied to the Downloads folder - WINDOWS prevented ONE file from being copied (Error 0x800700E1 ... because the file contains a virus or potentially unwanted software) namely
jpg_image.exe 21,504 bytes
all the other files copied OK.
I am new to using both MASM64 and MASM32 (I am trying to get away from using Masm5.1 on DOSbox for 16 bit code - now concentrating and learning to use somewhat "newer" assembly) - initially MASM64 will be used only for trying out all the examples provided (while MASM32 would be my programing environment for simple stuff with the target being x64 Windows computer).
So far MASM32 is somewhat working OK for me - but I am not sure what to do with all the MASM64 files (all the files from install64.zip without jpg_image.exe + all the files from m64upd2.zip which unzipped OK).
At present I have
C:\masm32\
should I make a C:\masm64\ folder or put everthing masm64 into the 32 folder and use the 32 IDE to compile 64 stuff?
Until I resolve the jpg_image.exe - I plan to have a "dummy file" of the same name (just to keep the compiler etc quite from error reporting) - and will avoid any example asm code etc that make reference to this file.
EDIT: WINDOWS automatically deleted jpg_image.exe from the usb stick (as well as the install64.zip file)!
Hi Richard,
You are obviously not a script kiddie, so you did the right things. They is also a dedicated subforum for AV issues. (http://masm32.com/board/index.php?board=23.0)
Using makeit.bat, \Masm32\examples64\jpg_image\jpg_image.exe builds just fine, and there is no chance that something malicious could hide in 60 lines of code. We are all used to such issues - this is the price to pay if you work so close to the machine. Not a problem if you program as a hobby, but if you want to sell your stuff, you need a strategy.
Welcome to the Forum :thup:
@jj2007
Thanks for the welcome
Now that I think I am beginning to understand that the 64 stuff is "merged" into the masm32 folder (rather than a separate masm64 folder) - I tried merging the 64 stuff BUT I think I did something wrong and so I was not able to assemble jpg_image.asm (too many errors).
Would you be able to supply a directory listing of all the folders/files (with file sizes in bytes) for the masm32 folder with the masm64 additions? I suspect that with the different sized files I replaced with the wrong one and I may still not have correctly set up the folders right.
I will manually (or better still write a BASIC program) to check all the thousands of files to your reference list to see that the files are in the right place AND the right size.
If you look at the expanded form of the zip file, you copy the 64 bit stiff directly into the masm32 installation so you have,
bin64
examples64
help64
include64
lib64
m64lib
macros64
script64
test64
tools64
If you get all of the 64 bit stuff into the right place, it will work correctly.
Make sure you put the Microsoft binaries in the "bin64" directory and it should run OK.
There is some stuffup in what the AV scanners are doing with the one file and it is probably an accidental byte combination that it is squawking about as the source is clear and there is absolutely no problem with it.
Just put the "jpg_image.exe" aside for the moment and make sure you get the whole build environment up and working correctly.
Hi Richard,
Welcome to the forum.
QuoteThe Anti Virus software is WINDOWS 10 x64 Defender and I have no clue how to disable it.
https://support.microsoft.com/en-us/windows/turn-off-antivirus-protection-in-windows-security-99e6004f-c54c-8509-773c-a4d776b77960
@Vortex
Thanks for welcome. Thanks for link re Windows Defender.
@hutch--
Still problems...
Error Message (when trying to construct jpg_image.asm into .exe
Could not find c:\Masm32\examples64\jpg_image\jpg_image.exe
'\masm32\bin64\ml64.exe' is snot recognized as a ...operable program .... (ml64.exe DOES NOT EXIST ANYWHERE)
I notice that the bin64 \1033\ folder is EMPTY as well as the tools64 folder.
It would be nice to have a full directory listing so that I can determine what is missing for me...
Quote from: Richard on December 28, 2020, 12:58:50 AMml64.exe DOES NOT EXIST ANYWHERE
Check
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\ml64.exe
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\ml64.exe
If you have another VS version, put "12.0" or whatever you have.
Richard is right saying than ml couldn't be find in the C:\install64 directory.
The forum had no license to do that.
First provider is Visual Studio C++ (ML64 and ml32) and other versions downloadable with a little search.
It is also possible to use Uasm and Jwasm.
@TouEnMasm
@jj2007
No folders exactly as specified BUT over the last three nights, independent of the "MASM32/64 exercise" I have been downloading MS Visual Studio Community (and still going at 4 hours per night - ...
Searching for ML64.exe in Program Files (x86) results 4 (four) different sized files...
591,280 445,360 601,520 453,552 bytes
Which one do I use?
EDIT:- VISUAL STUDIO Community 2019
Hi Richard,
**********************************************
Files that must be obtained from Microsoft
Usually this is from a Visual Studio download.
**********************************************
---------------
bin64 directory
---------------
cvtres.exe
dumpbin.exe
editbin.exe
lib.exe
link.exe
link.exe.config
ml64.exe
msobj140.dll
mspdb140.dll
mspdbcmf.exe
mspdbcore.dll
mspdbsrv.exe
mspdbst.dll
mspft140.dll
msvcdis140.dll
msvcp140.dll
-----------
In dir 1033
-----------
bscmakeui.dll
clui.dll
cvtresui.dll
linkui.dll
LocalESPCui.dll
mspdbcmfui.dll
mspft140ui.dll
pgort140ui.dll
pgoui.dll
This is the full listing on my own machine.
This is the directory listing on my own box.
K:\masm32\bin64>dir /s
Volume in drive K is disk3_k
Volume Serial Number is 68C7-4DBB
Directory of K:\masm32\bin64
12/05/2020 11:49 AM <DIR> .
12/05/2020 11:49 AM <DIR> ..
27/09/2018 04:43 AM <DIR> 1033
29/08/2016 11:09 AM 66 assemble.bat
27/09/2018 04:56 AM <DIR> bak
12/01/2020 11:00 AM <DIR> copy
11/05/2020 12:09 PM 40,928 cvtres.exe
11/05/2020 12:09 PM 20,376 dumpbin.exe
11/05/2020 12:09 PM 20,584 editbin.exe
11/05/2020 12:09 PM 20,584 lib.exe
11/05/2020 12:09 PM 1,429,112 link.exe
12/01/2020 09:58 AM 409 link.exe.config
20/08/2017 12:47 PM 623 Microsoft_File_List.txt
11/05/2020 12:09 PM 449,664 ml64.exe
21/02/2017 01:36 PM 140,456 msobj140.dll
12/01/2020 09:58 AM 306,760 mspdb140.dll
21/02/2017 01:36 PM 1,313,960 mspdbcmf.exe
21/02/2017 01:36 PM 588,456 mspdbcore.dll
21/02/2017 01:36 PM 184,488 mspdbsrv.exe
21/02/2017 01:36 PM 567,968 mspdbst.dll
21/02/2017 01:36 PM 2,362,024 mspft140.dll
21/02/2017 01:36 PM 1,299,120 msvcdis140.dll
21/02/2017 01:36 PM 627,368 msvcp140.dll
12/01/2020 09:58 AM 99,760 nmake.exe
20/08/2018 06:32 AM 460,800 poasm.exe
22/03/2015 03:26 AM 79,360 polib.exe
22/03/2015 03:28 AM 152,576 polink.exe
22/03/2015 03:48 AM 176,128 porc64.dll
22/03/2015 03:48 AM 48,640 porc64.exe
18/03/2019 08:50 PM 70,088 RC.Exe
27 File(s) 11,057,306 bytes
Directory of K:\masm32\bin64\1033
27/09/2018 04:43 AM <DIR> .
27/09/2018 04:43 AM <DIR> ..
11/05/2020 12:09 PM 34,176 atlprovui.dll
11/05/2020 12:09 PM 16,768 bscmakeui.dll
11/05/2020 12:09 PM 564,104 clui.dll
11/05/2020 12:09 PM 13,696 cvtresui.dll
11/05/2020 12:09 PM 88,960 linkui.dll
21/02/2017 01:36 PM 23,720 LocalESPCui.dll
05/10/2017 01:32 AM 164 lst.txt
11/05/2020 12:09 PM 15,240 mspdbcmfui.dll
11/05/2020 12:09 PM 84,560 mspft140ui.dll
11/05/2020 12:09 PM 21,376 nmakeui.dll
21/02/2017 01:36 PM 26,288 pgort140ui.dll
11/05/2020 12:09 PM 27,520 pgoui.dll
12 File(s) 916,572 bytes
This is the default VS installed directory on my box.
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\Hostx86\x64>
Use the binaries from this version, the x86 version is faster than the others.
You will find the 32 bit ML.EXE a bit lower in that directory tree.
The ML64.EXE version in this tree is 450984 bytes.
@hutch--
Thankyou for the information.
I took a gamble and used the largest ml64.exe file (601,520 bytes) and created the jpg_image.exe file. Seems the ml64.exe works. Refer attachment of screenshot - is this what running jpg_image exe supposed to do?
Interestingly MS Defender AV (still active as I have not switched it off) did not complain!!!
It is 2 am now - I am going home to bed - will investigate/follow up on the many "missing files" as per your directory listing later on after sleep.
Thanks everyone.
Hi Richard,
Yes, its a simple display of a PNG image in a dialog window.
Some versions needs tbbmalloc.dll
@TimoVL
Thanks for info.
Just in case I will need same - will search for dll file (first will try in my Visual Studio Folder).
When I do source the file - EXACTLY where do I place it in my MASM32 folder?
Hutch can explain a directory structure for you.
Just use a private folder for source code, as it will be easier for making backups.
Richard,
If you need that DLL, put it in the bin64 directory.
This reply is just for reference (will be constantly edited with updates) on my adding all necessary files. The zip file is a screenshot summarizing changes etc. If something goes wrong, eg incorrect file version used, this might be a useful way for someone to check my system.
Notation used for the empty folders...
first line full path on my computer where I sourced files for inclusion into masm32 folder
present... the already exisiting files (with size in bytes)
Q... major relative size difference compared to hutch-- dir list
replacing... exisiting (6) files showing the original file sizes
xxx... not sure yet
This reply will be edited without notice mainly by addition of date labeled zip files
Antivirus is a shitware, delete it.
14.28.29333
tbbmalloc.dll
vcruntime140_1.dll
msvcp140_atomic_wait.dll
http://masm32.com/board/index.php?topic=8119.msg89111#msg89111
Tested on my computer adwcleaner.
It has stopped the false alert to virus on this forum and other locations.
He is free,test it and report which results go with it.
(have not finished adding files as mentioned above...)
Background - my assembly experience is limited to 8086 only (not 80186+) using MASM 5.1 (16 bit). Because of various problems with DOSbox (which is only written as an emulator for Games) - I am (trying to) converting to present day assembly and giving MASM64 SDK a try (rather than 32). I appreciate that programming 64 bit can be "messy" and is "not for the faint hearted". I am very slowly going through all the 64 bit examples I can find to try out and learn from. Initially also I will try to convert my 16 bit code into hopefully working 64 bit code and my first program is Richard-001.asm included here.
Help with Richard-001.asm (too many errors) would be appreciated. Screen shot from DOSbox and errors (MASM64 SDK) attached in zip file. Note the screenshot (DOSbox) did not capture the flashing Yellow X's but they were visible when running DOSbox.
Eventually I will also try to write the code with newer style layout (eg console boxes) but for now I would like the classic DOS screen look.
; Richard-001.asm
;
; This program puts YELLOW flashing X in TOP ROW CORNERS and WHITE X in BOTTOM ROW CORNERS
; works with DOSbox + MASM 5.1(16 bit)
name Xy ; Richard-001.asm
.model small
.stack 100
.data
MSG DB 'X$' ; Message to print is "X" $ terminated string MSG DB "X$",0
.code
start:
push ds
; put YELLOW flashing X at TLHC (Top Left Hand Corner)
mov ah,02h
mov bh,00h ; page number 0
mov dh,00h ; 00h is top row
mov dl,00h ; 00h is left column
int 10h ; VIDEO - set cursor position (FirstRow, FirstColumn)
mov ah,09h
mov al,58h ; "X" char to display
mov bh,0 ; page number
mov bl,8eh ; attribute e= 14. = YELLOW 8x = flashing
mov cx,01h ; number of times to write character
int 10h ; VIDEO - write character and attribute at cursor position
; put YELLOW flashing X at TRHC (Top Right Hand Corner)
push ds
mov ax, 0b800h ; need preceeding 0 else is name ;mov ax,0xb800
push ax
pop ds
mov word ptr ds:[0+158],8e58h ; YELLOW flashing X TRHC (FirstRow, LastColumn) ;0],0x0e58
pop ds ; LastColumn(=79.)*2 since WORD (CharByte+AttributeByte)
; put X (only WHITE) at BLHC (Bottom Left Hand Cormer)
mov ah,02h
mov bh,00h ; page number 0
mov dh,18h ; 00h is top row
mov dl,00h ; 00h is left column
int 10h ; VIDEO - set cursor position (LastRow, FirstColumn)
mov dl,58h ; X @ cursor
INT 21h ; DOS 1+ - write character to standard output
; put X (only WHITE) AT ~BRHC (approx Bottom Right Hand Corner)
mov ah,02h
mov bh,00h ; page number 0
mov dh,18h ; 00h is top row
mov dl,79-1 ; 00h is left column - cannot write to LastColumn (=79.) since CrLf
int 10h ; VIDEO - set cursor position (LastRow, LastColumn-1)
push ds
mov ax,@DATA ; resolved by linker
mov ds, ax
lea dx, MSG
mov ah,09h ; DOS 1+ write string to standard output
int 21h ; DS:DX -> $ terminated string return al = 24h the "$" terminating the string
pop ds
; SET CURSOR POSITION ~HALF-WAY UP SCREEN
mov ah,02h
mov bh,00h ; page number 0
mov dh,08h ; 00h is top row
mov dl,40h ; 00h is left column
int 10h ; VIDEO - set cursor position mid screen
pop ds
MOV Ax,4C00H ; - terminate with return code
INT 21h ; EXIT
retf
end start
Note that the target computer is INTEL i7 processor x64 only.
EDIT 2020dec30 INTEL i7 processor x64 Windows 10 latest build 20H2
EDIT 2020dec31 changed code to Courier Bold Size=15pt (gives monospaced display)
EDIT 2020dec31 removed "[" in commented line of TRHC... (I don't know why this effect with "[") ZIP file NOT EDITED
EDIT 2020dec31 NOT MENTIONED ANYWHERE - program assumes 25 row 80 column text screen (classic DOS style text screen)
Assembles and works mostly fine on my Win7-64 machine. The X is yellow but doesn't flash :sad:
One minor typo: the line with 0x0e58 must move up behind the comment.
@jj2007
Could you send me the exe file etc and screenshot you successfully generated. I would especially like to try the .exe file in windows 10.
Thanks
EDIT just looked at FourX.zip BUT Windows 10 says for FourX.exe...
This App cannot run on your PC.
EDIT When attempted to launch FourX.exe from Windows 10 x64 (build 20H2) File Explorer
It's attached above.
Hi Richard,
Its been a while since I saw genuine 16 bit real mode code. Humour is I started MASM with version 6.0 that was structured differently from 5.1 and while I have seen notation for the older versions, I never used them. I never try to discourage anyone but the jump from 16 bit real mode code to 64 bit protected mode code may be a bit too much in one go, 32 bit MASM code is reasonably straight forward and is no slouch performance wise.
Once you get a feel for 32 bit protected mode programming and the Windows API functions, 64 bit Windows code is another large jump as it has different internal architecture and it very intolerant to the slightest errors. Its great stuff once you get the swing of it and the range of what it can do is impressive but ML64 has the characteristic of "Biting the hand that feeds it" for the tiniest error. On the bright side, it will certainly improve your coding style.
@hutch--
Thanks for comments.
I was "pre-warned" but since I am on a "learning curve" whether it be 64 bit or 32 bit - I may as well take on the challenge of 64. I will also learn 32 bit - to this end I did a "fresh install" of MASM32 SDK but on a G:\ drive (MASM64 SDK is on C:\ drive) as I cannot seem to have both 32 and 64 on the C:\ drive (maybe I did something wrong in this respect).
Yes - I will simultaneously now do Richard-001.asm in 32 bit (as well as 64 bit) - and dual-mode (32/64) from now on for future programs. It would be nice if (eventually) everything of mine (assembly) that sort-of works in DOSbox + MASM 5.1(16bit) is ported to 64 bit (as well as 32 bit).
I don't know if I did something wrong but so far I have not got a version (32 or 64 bit) of Richard-001.exe that works on my Windows 10 x64 (Intel i7 Processor) Build 20H2. the exe file from jj2007 (FourX.exe) does not work for me (ERROR MESSAGE - This App cannot run on your computer - when trying to launch FourX.exe from Windows 10 x64 Build 20H2 File Explorer). Can someone enlighten me on this. I would appreciate a copy of the exe file that forum members produce for Richard-001.asm (for both 32 bit and 64 bit).
Challenge to everyone (no prizes rewarded) - produce an exe code of ALL or ANY PART(s) (eg only say one X routine) of Richard-001.asm and supply the exe with attached notes on what (if anything) was needed to be done to make it work - this will assist me greatly in my learning curve 32/64
In a "nut-shell" initially with my old 16 bit code - using 64 (as well as 32) is like using a "sledge hammer to hit a pin into a pin-cushion" (a bit of a overkill), but it may be the best way for me to go in learning the SDK. Certainly I am studying any examples of all code supplied on the forum and supplied with SDK installs (a very large collection).
PS I am still getting the "hang of it" re presentation aspects of replies for this forum. Just a few minutes ago I "discovered how to display as "monospace"" (I hate proportional space for code)
Ps I still have not finished adding all needed/recommended files for MASM64 .
Quote from: Richard on December 31, 2020, 11:11:30 AMthe exe file from jj2007 (FourX.exe) does not work for me (ERROR MESSAGE - This App cannot run on your computer - when trying to launch FourX.exe from Windows 10 x64 Build 20H2 File Explorer). Can someone enlighten me on this.
Your source and my exe are 16-bit code. It will not run directly on x64 Windows versions. If you open the *.asc file I posted with RichMasm (http://masm32.com/board/index.php?topic=5314.0), you will see at the end the secret that makes it assemble and run:
OPT_Run \Masm32\bin\msdos.exe FourX.exe ; download (http://takeda-toshiya.my.coocan.jp/msdos/index.html); use binary\i486_x64\msdos.exeSince you seem to like BASIC: With a MasmBasic (http://masm32.com/board/index.php?topic=94.0) installation, you get a little extra: \Masm32\MasmBasic\Res\HelloWorld16.asc is a template with a number of BASIC macros as
16-bit Assembly. However, this is history - you should go for 32-bit Assembly. If you were a young programmer in his twenties, or a seasoned 32-bit assembly expert who must earn a living with coding, then I would recommend 64-bit Assembly, too.
Hi, Richard! Happy New Year!
Why are you writing 16-bit programs for DOS (the DOS died in 1995) if you want to learn how to program for 64-bit Windows? Why not start with 64-bit programming right away? I knew there are many perverts in the European Union, but I had no idea the scale and did not know that this would affect the programming in assembly language... (https://wasm.in/styles/smiles_s/scratch_one-s_head.gif)
@Miki__
I am actually trying to avoid 16-bit programs (via DOSbox + MASM 5.1 (16 bit)) - an important aim of mine is to convert all (or most) of my existing 16-bit assembly stuff to a "newer" assembly platform than my current 16-bit combo. I have only just started with MASM 64 (32) SDK and it looks like it will be quite some time until I am up and going.
I am also using QB64 (BASIC x64) for higher level programming but trying to interface into assembly for ultimate speed performance for straight forward simple sounding tasks (e.g. sorting fixed length strings and graphics) - however my ability (at this stage) prevents me using x32 and x64 assembly.
Also I am trying out FreeBASIC (DOS version) in a similar manner - with the ultimate aim of a DOS like environment WITHOUT windows present. Windows 10 x64 has proven to me to be unstable and sometimes certain results are unpredictable (as if it was throwing in random events). I have given up with windows for a high precision timer (approaching microseconds on my 2.4 GHz Intel i7 x64 computer) - it displays using an API resolution down to microseconds but repeatability/accuracy is extremely poor for me.
Quote from: Richard on December 31, 2020, 04:32:56 PM
Also I am trying out FreeBASIC (DOS version) in a similar manner - with the ultimate aim of a DOS like environment WITHOUT windows present.
Well, here,'s your sample program, translated to 64-bit DOS: :bgrin:
; Richard-001.asm
;
; This program puts YELLOW flashing X in TOP ROW CORNERS and WHITE X in BOTTOM ROW CORNERS
; works with DOSbox + MASM 5.1(16 bit)
name Xy ; Richard-001.asm
.x64
.model flat
; .stack 100
option casemap:none
include dpmi.inc
@int macro no
call int_&no
endm
.data
MSG DB 'X$' ; Message to print is "X" $ terminated string MSG DB "X$",0
dosmem dw 0 ;segment address DOS memory
rmcs RMCS <> ;DPMI real-mode call structure
.code
start:
;push ds
;--- allocate 16*16 bytes dos memory
mov ah,48h
mov bx,10h
@int 21h
mov ax,rmcs._BX
mov dosmem,ax
; put YELLOW flashing X at TLHC (Top Left Hand Corner)
mov ah,02h
mov bh,00h ; page number 0
mov dh,00h ; 00h is top row
mov dl,00h ; 00h is left column
@int 10h ; VIDEO - set cursor position (FirstRow, FirstColumn)
mov ah,09h
mov al,58h ; "X" char to display
mov bh,0 ; page number
mov bl,8eh ; attribute e= 14. = YELLOW 8x = flashing
mov cx,01h ; number of times to write character
@int 10h ; VIDEO - write character and attribute at cursor position
if 0 ; put YELLOW flashing X at TRHC (Top Right Hand Corner)
push ds
mov ax, 0b800h ; need preceeding 0 else is name ;mov ax,0xb800
push ax
pop ds
mov word ptr ds:[0+158],8e58h ; YELLOW flashing X TRHC (FirstRow, LastColumn) ;[0],0x0e58
pop ds ; LastColumn(=79.)*2 since WORD (CharByte+AttributeByte)
else
mov word ptr flat:[0b8000h+158],8e58h
endif
; put X (only WHITE) at BLHC (Bottom Left Hand Cormer)
mov ah,02h
mov bh,00h ; page number 0
mov dh,18h ; 00h is top row
mov dl,00h ; 00h is left column
@int 10h ; VIDEO - set cursor position (LastRow, FirstColumn)
mov ah,2
mov dl,58h ; X @ cursor
INT 21h ; DOS 1+ - write character to standard output
; put X (only WHITE) AT ~BRHC (approx Bottom Right Hand Corner)
mov ah,02h
mov bh,00h ; page number 0
mov dh,18h ; 00h is top row
mov dl,79-1 ; 00h is left column - cannot write to LastColumn (=79.) since CrLf
@int 10h ; VIDEO - set cursor position (LastRow, LastColumn-1)
;push ds
;mov ax,@DATA ; resolved by linker
;mov ds, ax
lea rdx, MSG
mov cx,sizeof MSG ;copy MSG to conventional memory
call copy2dos
mov ah,09h ; DOS 1+ write string to standard output
@int 21h ; DS:DX -> $ terminated string return al = 24h the "$" terminating the string
;pop ds
; SET CURSOR POSITION ~HALF-WAY UP SCREEN
mov ah,02h
mov bh,00h ; page number 0
mov dh,08h ; 00h is top row
mov dl,40h ; 00h is left column
@int 10h ; VIDEO - set cursor position mid screen
;pop ds
MOV Ax,4C00H ; - terminate with return code
INT 21h ; EXIT
retf
int_10h proc
mov rmcs._AX, ax
mov rmcs._DX, dx
mov rmcs._BX, bx
mov rmcs.rSSSP,0
lea rdi,rmcs
xor cx,cx
mov bx,10h
mov ax,0300h
int 31h
ret
int_10h endp
int_21h proc
mov rmcs._AX, ax
mov rmcs._DX, 0
mov rmcs._BX, bx
mov cx,dosmem
mov rmcs.rDS,cx
mov rmcs.rSSSP,0
lea rdi,rmcs
xor cx,cx
mov bx,21h
mov ax,0300h
int 31h
ret
int_21h endp
copy2dos proc ;copy CX bytes from RDX to dosmem
push rdi
push rsi
movzx edi,dosmem
shl edi,4
movzx ecx,cx
mov rsi,rdx
rep movsb
pop rsi
pop rdi
ret
copy2dos endp
end start
It works, I tested it. However, I'm afraid it won't run in DOSBox - and most likely also NOT in VBox, because those virtualizers won't emulate a 64-bit cpu ( at least not if you choose DOS as environment ).
It may work in Qemu, though. AND: it works on bare metal.
You might be able to assemble the source with Masm 64-bit (if you delete the .x64 line ) - but MS has decided that mixing 64-bit and 16/32-bit code is something that nobody needs or wants. I used jwasm instead.
Attached is a zip that contains the source, the tools required and a MAKE.BAT to generate the executable.
@_japheth
Thanks for reply.
I do not see the attached zip file etc - please check.
Also please attach the exe file as well in case I cannot generate for some reason.
@_japheth
Just tried your zip and ran MAKE.BAT
In Windows 10 x64 File Explorer (double clicking) got the following ERROR MESSAGE...
The C:\...\Richard-001.exe application cannot run in WIN32 mode.
Any idea how to overcome this error?