Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading the MIDI Port address

Status
Not open for further replies.

neworbits

Programmer
Mar 24, 2002
9
US
I'm just an absolute self-instructed beginner, so please excuse my non-asm ways of speaking about these things.

How do you read the MIDI port address? All I want to do is press a note on the MIDI, then run this little program, and see what code was sent to the MIDI port address.

I've tried the following:

mov(eax,330); // 330h is the standard MIDI port address
and
mov eax,$330, mov( $330, eax ); // HLA syntax

and I've tried this with HLA, MASM, and TASM, but can't seem to get any result in output except the hex for decimal 330 or else "330"! LOL

Any help will be greatly appreciated.
 
Try 'in' instead of mov. 'mov' refers to immediate values, registers, and memory variables, NOT I/O ports. I/O is done only by 'in' and 'out'.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Thank you for your kind attention to my question.

I got an initial impression from Randall Hyde's Art of Assembly that, because 330h is beyond the first 255 16-bit addresses in the i/o port address area, in/out were not useable for things like MIDI ports. Yet as I write this I have converted 330h to 816d and then divided by 16 (since i/o address space is 16-bit), and so the MIDI address that the BIOS reports, turns out to be only the 51st 16-bit i/o address. Hence you are correct, and this impression was apparently the result of my conflating hex and decimal.

So does

IN( eax, $330 ); // (Using standard masm syntax)

copy the entire 32-bit dword of data from MIDI keypresses, even though it is connected to the game port? I assume there is some intelligence from the MIDI unit that enables it to send the code to 330h-331h (this is what the BIOS reports for MIDI), even though the game port address for 32-bit data is the range 201h-202h (again according to the BIOS)?


I want to ensure I'm getting the full result of a MIDI keypress stored in eax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top