×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Reading the MIDI Port address

Reading the MIDI Port address

Reading the MIDI Port address

(OP)
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"!  

Any help will be greatly appreciated.

RE: Reading the MIDI Port address

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."

RE: Reading the MIDI Port address

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close