News:

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

Main Menu

Asteroids: Here we go

Started by sewardsb, November 21, 2013, 08:26:26 AM

Previous topic - Next topic

FORTRANS

Quote from: dedndave on November 27, 2013, 05:23:28 AM
the easy way......

assemble the .IF version
disassemble the resulting EXE using \masm32\bin\dumpbin.exe

Hi,

   Why do you think that is easier than producing a listing?

Regards,

Steve N.

dedndave

i guess you can go that way too - lol
i have a "dis.bat" batch file that makes it pretty fast   :P

sewardsb

Thanks for the suggestions on switch statements and de-compiling, but I'm not sure that I can do either. Like I initially posted, I really am bogged down to the bare minimum of using Irvine32. I can compile my solution to produce an .exe in the debug folder, but all other files are object or tlog files.

dedndave

ML.exe can produce listing files by adding "/Fl" to the command line option switches
that's an "F" and a lower-case "L"

for DumpBin...
DumpBin /DISASM YourProgram.exe

normally, you want a text file, so....
DumpBin /DISASM /OUT:SomeFile.txt YourProgram.exe

when it's done, i think you may have to press the enter key to get past the Pause

Magnum

l and | are kind of similar. (lower case L and -----?)

I am curious as to what the second symbol is ?

I think I have used that symbol in some assembly code and for starting multiple windows in Firefox.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

dedndave

i always called it a "pipe symbol" because DOS used it to pipe commands   :P
try googling "glidus"

sewardsb

Question 5: Is there a way to generate a system sound (even just a beep from something like the sound gate)? I've looked everywhere for anything related to Irvine32/Masm, and the closest I could find was to get the object file from a higher language, include that file, and call the func in assembly.

I found http://2k8618.blogspot.com/2010/04/beep-sound-1-assembly-language-masm.html this old link, but I am unsure of the .model TINY directive and .STARTUP alternative directive being used, and if they are even needed with MASM. I use both the data and code segments respectively. I also tried implementing this code, but the syntax is completely different.

dedndave

    INVOKE  Beep,800,40
800 is the tone frequency
40 is the duration in mS
Beep does not work under Vista
under Vista, you want to use MessageBeep

http://msdn.microsoft.com/en-us/library/windows/desktop/ms680356%28v=vs.85%29.aspx

for example:
    INVOKE  MessageBeep,MB_EXCLAMATION
the sounds for each type are user selectable (control panel, sounds)

there are other ways to makes sounds, using MultiMedia functions
you could also store a WAV file in resource and call PlaySound

sewardsb

I haven't really gotten into including files. If I am running on Win7 or 8 and have Irvine32 MASM running in visual studio, do I need to include any C++ files in my solution/.asm file for the Beep/MessageBeep operand to work (looks like it requires User32.lib)?  :redface:

Update: Beep is undefined


INCLUDE Irvine32.inc
INCLUDELIB Kernel32.Lib
INCLUDELIB User32.Lib

extrn ExitProcess@4 : PROC    ;this std func works.. is there one for Beep?

.data
;vars here

.code
;main here

GenerateBeep proc
INVOKE Beep, 800, 40
ret
GenerateBeep endp

dedndave

all you should need is a PROTOtype
Beep  PROTO :DWORD,:DWORD
same is true for ExitProcess, except it only has one DWORD parm

now, if you have to declare the EXTRN, it's similar to ExitProcess, but change the 4 to an 8
that value represents the number of bytes pushed for parameters

Magnum

Does BEEP work under Win 7  and 8 ?

Andy


Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

GoneFishing

It works under Win 8 if only I turn on speakers (the built-in speaker is always silent)

dedndave

Beep works on all but Vista, as far as i know
something about the drivers
don't recall the details because i don't plan on using Vista   :lol:

jj2007

Quote from: vertograd on December 03, 2013, 08:15:43 PM
It works under Win 8 if only I turn on speakers (the built-in speaker is always silent)

Same for Win7-32.

sewardsb

Thanks for chiming in everyone! It can confirm I got it working on Win8 with the speaker on  :greenclp: