c:\MASM32> ML /c myprog.asm .
.486
.model flat, stdcall
;option casemap :none
.code
assume nothing
MyProc proc near
mov ebx,table
;comments
...
(more code, etc)
...
end
Myproc endp
Now my code STARTED to compile to line 54 and then every single line
after that was the same error message.
C:\work>\masm32\bin\ml /c t.asm >myfile
C:MYFILE L00001 C01 Insert
Assembling: t.asm
t.asm(54) : error A2044: invalid character in file
t.asm(55) : error A2044: invalid character in file
t.asm(56) : error A2044: invalid character in file
t.asm(57) : error A2044: invalid character in file
t.asm(58) : error A2044: invalid character in file
t.asm(59) : error A2044: invalid character in file
t.asm(60) : error A2044: invalid character in file
t.asm(61) : error A2044: invalid character in file
t.asm(62) : error A2044: invalid character in file
t.asm(63) : error A2044: invalid character in file
t.asm(64) : error A2044: invalid character in file
t.asm(65) : error A2044: invalid character in file
t.asm(66) : error A2044: invalid character in file
......
t.asm(153) : error A2044: invalid character in file
t.asm(154) : fatal error A1012: error count exceeds 100; stopping
assembly
Line 54 is a comment, followed by simple code as before.
; check the
possibles
shr eax,4 ;shift eax right 4
(55)
mov esi,7 ;init to 7 (56)
mov edi,9 ;9 th on (57)
This is how the program starts.
.386
.model flat, stdcall
option casemap :none
; include \masm32\include\windows.inc ; always first
;
; include \masm32\include\user32.inc ; system include
; include \masm32\include\kernel32.inc ; file next
; include \masm32\include\gdi32.inc
;
; includelib \masm32\lib\user32.lib ; matching system
; includelib \masm32\lib\kernel32.lib ; libraries after that
; includelib \masm32\lib\gdi32.lib
.code
.
MyProc proc near
mov ebx,table
;comments
...
(more code, etc)
...
end
Myproc endp
Why the error stream after line 54?
There are no manuals or documentation available on the various
assemblers in the Microsoft documentation. I am sure you can find
docs for the IA64 assembler somewhere on Intel's site.
>I'm fairly competent using MASM for 16 bit work, but when I try to use
>ML.exe (my first time) with 32-bit code and assemblere, with this
>following (partial) source file, the assembler objects to every
>line, then stops after 100 errors on 100 lines.
>How should I start the assembly process with the source fle
>"myprog.asm" and ask only to assemble and give me an error listing?
>When I get that far I MAY have more questions.
>The code is all simple "stuff".
<code snipped>
It's been a while since I downloaded my copy of MASM32,
but it came with tons of examples. I just started with the
examples and worked onward from there. There were also
Iczelion tutorials with their own examples and fairly detailed
explanations.
You may have to root around in your MAS32 directory to
find this stuff.
Best regards,
Bob Masta
DAQARTA v3.50
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Scope, Spectrum, Spectrogram, FREE Signal Generator
Science with your sound card!
Yes, I had looked around and even tried compling some examples; which
worked.
So I think my problem is I don't have included in my code all the
"include" files I thought weren't necessary, since I was only doing
register operations anyway. I'm slowly working through these examples,
very surprised as I progress, at the increasing use of macros and
external tools that these demonstrate; also the weird use of @@: @F:
and @B: dynamic labels, never sspected and guessed as defining,
Forward and Backword jump directions.
I never needed all this stuff as a humble programmer!
But there're VERY interesting frameworks there to build on, including
a pretty complete Windows application with pull-down menues and so on.
So my 30 minute project will end up as an MSc thesis on modern
assembler programming.
:0(> Oh well, I'm not 100 yet...
MASM also provides some 'C' like constructs for looping and flow
control. I don't use them since I write assembly when needed and
don't try to make it look like another language. I do use the
anonymous labels and even the externally referenceable labels when
needed. MASM does require blocks though some of the directives can
hide some of the block statements, but a listing with maximum output
specified can show you what was generated.
You can do a branch to a fixed memory location such as the BIOS by
defining a code segment and a target label in that segment. A reboot
in 16-bit boot code can call the reboot address located at the high
end of BIOS segment. There are many things that can be done, but it
takes practice and you have to keep at it since you loose it rather
easily over time.
The 'end' directive should be the last line - NOT inside the proc!
Are you willing to email me the entire source file? I'll see if anything
looks funny, like unexpected control characters.
What version of MASM is it? One of the early MASM 6 releases had a bug
that caused this problem if a line ended exactly on a 4096-byte boundary.
>.code
> assume nothing
You shouldn't use "assume nothing". The .code pseudo-op sets up some
assumes that make the assembly work properly.
>MyProc proc near
"near" and "far" will screw up your 32-bit assembly. Get rid of them.
> mov ebx,table
>;comments
>...
> (more code, etc)
>...
>
> end
>Myproc endp
Those last two are in the wrong order, but I assume that's just a problem
in typing the message.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
1) my ML.exe is V6.14.8444
2) There are some batch files in\mas32\bin, one of which is assmbl.bat
I use th basic part but not all of:-
@echo off
if exist "%1.obj" del "%1.obj"
\masm32\bin\ml /c /coff "%1.asm" > \masm32\bin\asmbl.txt
if errorlevel 0 dir "%1.*" >> \masm32\bin\asmbl.txt
\masm32\thegun.exe \masm32\bin\asmbl.txt
I understand the first lines, but what is program "thegun.exe for",
which uses the output listing?
3) I took the source code that gives me problems (down to T.ASM) and
stuck it in the demo2 tutorial program's main procedure instead of
"hello world".
Then I invoked the assembler using this line.
C:\FORTRAN>\masm32\bin\ml /c /coff t.asm >t.txt
Then I checked t.txt (the result: the assembly listing)
The assembly had gone crazy AS BEFORE, on the SAME LINE (now number
76), which is a comment.
I put the line numbers in brackets afterwords.
I checked the source with a binary dump. There are NO weird characters
or tabs, and all lines end cr-lf.
The very strange thing is I changed code lines, so the source is
different, but the crash is on the SAME COMMENT LINE which hasn't
changed????? (Also by chance the same line number).
test ax,ax ;is zero? (74)
jnz J01A4 ;hop if yes (75)
; check the possibles (76)
shr eax,16 ;shift top down (77)
Assembling: t.asm
t.asm(76) : error A2044: invalid character in file
t.asm(77) : error A2044: invalid character in file
t.asm(78) : error A2044: invalid character in file
t.asm(79) : error A2044: invalid character in file
t.asm(80) : error A2044: invalid character in file
t.asm(81) : error A2044: invalid character in file
And so on till line 176 (again 100 error lines).
So I took out the comment - problem MOVED DOWN to line 86! WHAT????
;loop on bit
SO I TOOK IT OUT!
Problem moved down to somewhere eles !! ON COMMENTS????
;loop on items
FINALLY I GOT IT!
The comments
;check
;loop
;save
and a few others, seem to trigger an error in the assembly, as if it
were a macro or something!
ANY IDEAS WHY????
I'm using a semi-colon than no space before the comment. Is this a NO-
NO?
(Mumble... things used to be simpler..)
I'm using a text editor which, under certain circumstances, can leave
my comments mangled, including changing a perfectly valid ":" comment
start symbol to the same screen character, but with an 8-bit set and
still showing ";", when it isn't!. One was enough; three were found.
Of course I had searched for tabs and all the usual foul-ups, but when
I realised what was happening and retyped the comments, the problem
went away!
> ANY IDEAS WHY????
No, but I've seen such wierd features in assemblers... I was using
one where '7' would generate the byte 37h, 'x' would spit out 78h,
but '#' would not get you anything useful. No errors, no warnings,
no documentation, just garbage code. Or WASM (at least used to)
dislike syntax like mov eax, [4+ecx+2*edx], preferring instead
mov eax, +4[ecx+2*edx]. Again, no errors, no warnings, just garbage
code. At least you are getting errors, and that's easier to debug.
Have you tried asking at the MASM32 forum,
http://www.masm32.com/board/index.php ? The answer may be totally
obvious over there, as you do seem to be using that package.
--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end
Come back, Notepad. All is forgiven!
Sounds like a nasty editor you have there. Reminds me of olden days
searching for invisible characters in normal-looking text. Yuck.
All the code was fine; just some text had a hex #BB in position 1 of
the line
;my comment, but that isn't a semicolon on my computer, but ends up as
one in this Forum!
It also shows as semicolon in WS.
This means their is a bug in both ML.exe version 5 and 6, thet, when
meeting this character, CYCLES ON THE SAME LINE complaining about
invalid characters until 100 messages went to stdout.
So you get to find one such error per pass, correct and re-assmble.
Should have proceded to parse further lins of source!
One more question**
How do I code the 32-bit doouble word "move string" operation? This
next is objected to.
movsd repz
Other way around. The prefix comes first:
rep movsd
or, if you prefer:
rep movs dword ptr es:[edi], dword ptr ds:[esi]