Comm API and LPT addresses

HI!
I want to implement a little programe in Java.
The programme looks something like this in asm:
asm{
mov dx,37Ah
mov al,3
out dx,al
mov dx,378h
mov al,3
out dx,al
The main problame is that the getOutputStream() function is related to 378h (LPT's data address) and I want to write to 37Ah (LPT's controll address);
How could I write to the other 2 addresses?

outport is a function from Borland C++. So you'll have problems using such function.
You'll need to use _outp, check the reference in MSDN.
You'll also need to use the statement
#pragma intrinsic(_inp,_inpw,_inpd,_outp,_outpw,_outpd)immediately below including #include <conio.h>
This is an excerpt from MSDN.
int _outp( unsigned short port, int databyte );
unsigned short _outpw( unsigned short port, unsigned short dataword );
unsigned long _outpd( unsigned short port, unsigned long dataword );
Routine Required Header Compatibility
_outp  <conio.h>     Win 95
_outpw <conio.h>     Win 95
_outpd <conio.h>     Win 95
The outp, outpw, and _outpd functions write a byte, a word, and a double word, respectively, to the specified output port. The port argument can be any unsigned integer in the range 0 � 65,535; databyte can be any integer in the range 0 � 255; and dataword can be any value in the range of an integer, an unsigned short integer, and an unsigned long integer, respectively.

Similar Messages

  • Comm API and Exception in SerialDemo

    I was able to compile the SerialDemo source into the application. However, when I run it, it throws an exception at line 560 of SerialDemo$ConfigurationPanel.listPortChoices
    This line deals with enumerating the available ports on a system. The exception is a NoClassDefFound (no such class) error. It is looking for javax.comm.CommPortIdentifier
    I have installed Comm API 2.0 according to the Win32 directions. I once had a prior installation working - at least listing what ports I actually had on the system - but even then the apps were unable to work with them at all.
    Anyone got ideas?

    i have this error when run SerialDemo:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPortIdentifier
    at SerialDemo$ConfigurationPanel.listPortChoices(SerialDemo.java:560)
    at SerialDemo$ConfigurationPanel.<init>(SerialDemo.java:448)
    at SerialDemo.<init>(SerialDemo.java:142)
    at SerialDemo.main(SerialDemo.java:89)
    My CLASSPATH :
    C:\j2me\midp2.0fcs\classes;C:\Benhui_Bluecove;
    C:\Benhui_Bluecove\classes;
    C:\WTK23\apps\BTGalleryExample\src;
    C:\Programmi\UCB\jdk1.4.1_02\j2sdk1.4.1_02\jre\lib\comm.jar;
    and i have followed the instructions that are at http://www.benhui.net
    These are the instructions :
    To get mine to work, I copied the 'comm.jar' and 'javax.comm.properties' files into the following locations:
    * <J2SE SDK installation directory>\lib
    * <J2SE SDK installation directory>\jre\lib
    * <J2SE SDK installation directory>\jre\lib\ext
    And copied the 'win32com.dll' into the following locations:
    * <J2SE SDK installation directory>\bin
    * <J2SE SDK installation directory>\jre\bin
    Can someone help me?
    Thanks
    Dani

  • Java comm api doubt.

    ive downloaded the comm api and installed it in my system (win 95) Ive followed exactly all the steps that are recommended and even changed by classpath. I still get the followin error message
    Excpetion in thread "main" java.lang.NoClassDefFoundError : SimpleRead/java.
    Please help.
    thanks
    G.P.

    u were right amolk, i did not include the period and that was the problem. thanks a lot and thank u too DrClap.
    G.P.

  • Comm API Problems

    Hi Everyone,
    I've just installed the comm API, and installation process seems to have gone quite smoothly, (the code is compilling correctly), but the demo programs will not run, i get the error:
    Exception in thread "main" java.lang.NoClassDefFoundError: SimpleWrite
    or the same error coming from SimpleRead.
    Any ideas on whats going on?
    Andrew

    You can't use directory names that have a space in
    them when using Java.Okay, I've uninstalled the java sdk, installed it to
    C:\jdk
    copied the win32.dll to the jdk\bin directory
    and the properties and comm.jar file to the jdk\lib directory
    reset the classpath using
    set CLASSPATH=c:\jdk\lib\comm.jar
    and it's still not working, any other suggestions?

  • Message Exception and Internet Address exception in Java mail API

    Hi,
    Using JAVA mail api while using sendmessage method i am getting Invalid address exception..TO address and from address are same as my mail id..Someone please tell why these exceptions come.
    Thanks..

    To prevent spammers using your system's mail transfer agent as a channel for spam most MTAs are set up to send message either from a recognised local address to a remote address, or from remote to local. "Unable to relay" generally means that your MTA doesn't recognise the machine that tried to send the e-mail as "local".
    You probably need to make changes to the configuration of the MTA (Sendmail or whatever) that runs on the machine you've designated as mail host.

  • Stand Alone OC4J  and Java's Comm API

    I am using the Java Comm API alongwith a servlet. The code simply gets the required ports and displays it in a JSP page. The program is developed using Jdeveloper 9. It works fine with embedded OC4J but a blank jsp page is displayed when deployed in in standalone OC4j instance on the same machine. I have correctly copied the required wincom32.dll, java.comm.properites and comm.jar to the jre/bin, jre/lib and jre/lib/ext respectively. What could be wrong.
    Thanks
    MMN

    Try setting the OS PATH env variable to the directory where the .DLL is located before you launch the container. Or else put the .DLL in a directory which is in the existing path.
    cheers
    -steve-

  • How to show users display name and email address in open social widget?

    Hello experts,
    Is it possible to retrieve users display name and email address with opensocial javascript e.g. Login widget seems to load user data (and userData.firstname) during the site init. Is this something that could be consumed or is there some opensocial data request that could/should be used. Any working sample widget spec would be appreciated.
    Best regards,
    Ville

    Hi Ville,
    in the logon widget, we also use the data retrevied from siteInit.loadData.data.user. However, this widget is part of the out of the box openSocial widgets, it is being released with the product code, not as a separate OS widget deployed on HANA Cloud Platform.
    If you'll do window.parent.siteInit you'll probably will get the data you are looking for, but this isn't the official public API, so you can use it but we cannot commit on keeping this structure.
    Why do you need this information in the widget level? Does your widget require authentication or is it for personalization needs?
    The best way is to retrieve this info on the java side using HAHA Cloud Platform APIs and send them back to the client.
    Look at this - SAP HANA Cloud Platform SDK >
    Package com.sap.security.um.user
    Interface:
    User
    This interface provides read access to user data and is an extension of Principal.
    UserAttribute
    The interface represents abstraction over a user general attribute, such as an e-mail address.
    UserProvider
    This interface represents the service interface which provides read access to a user implementation.
    Inbal 

  • How to email a list of names and email addresses?

    I have a group of about 60 people with various amounts of data in each of their Address records.
    I want to send an email to the group with a list of the names and email addresses of everyone on the list. I don't know how to do this neatly. Got any ideas?
    If I put the group name in "to" in Mail, each person gets a messy non-alphabetical list with commas. If I send a group vCard, I send more data than I want to send. If I make a printed list, I have to convert to a pdf file and send that which is not nearly a simple as a text list.
    Is there any way to export fields of my choice from Address into either text or spreadsheet format?
    I want to send a list like this, but with tabbed columns.
    Steve Jobs [email protected]
    Barack Obama [email protected]
    yourname1 yourname2 [email protected]
    Thanks,
    Phil

    Thanks, Thomas for the prompt response, but the pdf method has two problems.
    First, it's got to be in landscape mode, or the email address word-wrap. That makes for a five-page list. I want to send a 60-line text list.
    Secondly, there's no way to eliminate the label (work, home, other...) from the email address field.
    I will use the pdf method if no one comes up with a better idea.

  • How to use the COMM API in a JAR file

    I have developed an application, using the NetBeans IDE, to communicate with a modem over the COM1 serial port using the Java Comm API. The application works fine within the IDE, but when a JAR file is created and "double-clicked", the application launches correctly, but when the code is executed to "talk" over the COM1 serial port - nothing happens. No exceptions and no warnings are thrown. My environment is XP, SP1.
    The manifest file is as follows:
    Manifest-Version: 1.0
    Class-Path: ../j2sdk1.4.2/jre/lib/ext/TimerBean.jar ../j2sdk1.4.2/jre/
    lib/ext/AbsoluteLayout.jar ../j2sdk1.4.2/jre/lib/ext/comm.jar
    Created-By: NetBeans IDE
    Specified-By: Projects/TheApp/Files/TheApp.jarContent
    Main-Class: Main
    According to the Comm API installation instructions, the following files are copied:
    copy comm.jar \j2sdk1.4.2\jre\lib\ext
    copy wind32com.dll \j2sdk1.4.2\bin
    copy javax.comm.properties \j2sdk1.4.2\jre\lib
    I suspect it has something to do with the paths.
    Any help would be greatly appreciated. Thanks.

    Thanks for your input, but after trying what you suggested the problem still exists. I think your right to be suspicous of the javax.comm.properties file. The application, that worked in the IDE, exhibits the same behavoir as the JAR file if the javax.comm.properties file is removed from the ../jre/lib directory. In other words it compiles correctly in the IDE, but when executed, nothing happens when the code that "talks" to the serial port is run.
    I've tried moving the javax.comm.properties file into the working directory. Also, the CLASSPATH and PATH system variables were modified to include the path to javax.comm.properties.
    If you have anymore ideas, please let me know.
    Thanks.

  • My last chance...for comm api with applet

    Hi to u great valued developers,
    Did anybody on earth the same as I do:
    Create and deploy a signed applet including the java comm api lib.
    The applet is deployed on an Apache Server and should run under IE6
    Easy? sure but something is certainly missing in the cab 'cause altough no error is return in console, I either do not receive any info from the ports.
    Same app compiled as application is ok.
    Thanks very much for any help.
    Cedric ([email protected])

    Hello Enrique,
    tx for ur answer.
    As said, the application (reading serial ports) works fine.
    The problem come possibly from javax.comm.property.
    Should I package it with the cab?

  • Including a DLL in JAR file (Comm API)

    Writing a little app that interfaces with serial port device using the communications API and I'd like to bundle it into an executable JAR. JBuilder will create the JAR for me fine, but the issue is with the win32com.dll file thats part of the comms API. I need to include this, I don't think its possible to include as part of the executable, but otherwise the DLL needs to be in the windows\system folder. Could I include the dll as part of the JAR archive and then extract it upon runtime? If so how would I go about this?
    Any help much appreciated.

    There is another option. Native libraries need to reside within the java.library.path location. As it turns out, if you, at runtime, grab this property and ADD your own location to it, then set it back in to the System.setProperty() call, it will NOT work. The only way to do it is the -Djava.library.path value that tjmaven suggested.
    However, if you read up on how a native library is found, it uses the ClassLoader.loadLibrary() which calls the protected findLibrary() method. You can therefore extend ClassLoader to find a path yourself.
    One way is to extend URLClassLoader since it has the protection/security stuff AND the ability to look in .jar files for you. Your custom loader is created by a "launcher" class in your .jar file. First, your luancher uses getClass().getProtectionDomain().getCodeSource().getLocation() to get the absolute location of the .jar file its executing within. From there, you open the jar and look for your native library, extract it using the JAR api to a location of your choosing. Now, you instantiate the custom classloader and using this custom loader instance you load the rest of your classes. The main .jar file contains two classes, the launcher and the custom classloader, and contains the native library if you wish to do it this way. The custom classloader, you specify a URL[] of "classpath" entries. You bundle up the rest of your source in a second .jar file that you pass to the URL[] when creating the custom classloader. It will find all your classes in the 2nd jar no sweat. You can even "reload" these classes on the fly by recreating the custom classloader instance if you so wish to add a sort of "reload" feature.
    Now, in your custom classloader, you override the findLibrary() and return the SAME STRING PATH that you used to unjar your native files to. This way, when the JVM asks your custom loader to load the library at some path, you return the right path to find the native files in.
    I haven't verified that this works just yet, but I will soon. Primarily, my plugin engine over at www.platonos.org will support the ability to place native libraries in plugins, allowing you to effectively wrap a native library use as a plugin. Not yet working, but we'll soon have it in place.

  • Trying to use javax comm api in Windows Environment

    I am working on developing a module to dial a phone number in a Windows environment. This is to test a voicemail connection so it isn't, necessarily, calling a modem.
    A couple of questions:
    1) I found the javax comm api but it appears Sun has only provided a Solaris and Linux version - where would I find a Windows version?
    2) I was planning on dialing a modem with the voicemail phone number (programmatically, of course). I, then, want to recognize response and react to it - possibly stopping only with seeing that the phone number answered (since I don't want to write voice recognition software). Am I on the right track?
    Ed

    I don't know of any devices named "/dev/term/a" - and that's both Linux and Solaris.

  • Error in the latest Java comm api for Linux

    installed latest Java comm api for Linux, tried test application for the Sun package:
    $ java SimpleRead
    Exception in thread "main" java.lang.ExceptionInInitializerError
    at SimpleRead.main(SimpleRead.java:67)
    Caused by: java.lang.NullPointerException
    at javax.comm.CommPortIdentifier.findConfFile(CommPortIdentifier.java:199)
    at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:117)
    ... 1 more
    What deis this message mean? How to make you serial port support work?

    and what does this error message mean??
    The package was installed accordingly to "Java(tm) Communications API Linux Installation Instructions":
    $ls /usr/lib/libLinuxSerialParallel.so
    /usr/lib/libLinuxSerialParallel.so
    $env|grep CLASS
    CLASSPATH=<..skipped..>:/opt/commapi/jar/comm.jar:/opt/commapi/jar/commtest.jar
    $ ls /opt/jdk1.5.0_04/jre/lib/javax.comm.properties
    /opt/jdk1.5.0_04/jre/lib/javax.comm.properties
    What else does it need?

  • Configure comm.api in tomcat

    hello friends,
    i want to configure comm.api in tomcat5.5. please help me
    Thanks in advance.
    javax.comm: Error loading javax.comm.properties!
    null
    java.io.IOException: javax.comm: platform driver class name = null
    (Check 'driver' property in javax.comm.properties)
    at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:244)
    at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:109)
    at welcome.list(welcome.java:47)
    at welcome.doGet(welcome.java:21)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)

    If your operating system works it as a comm port you can readily run the BlackBox example that comes with the comm 2.0 API and see if it picks it up.

  • Problem in Accessing serial port using java comm Api

    I have installed java comm Api in my pc.
    i have gone through the instalation instruction which comes on this package.
    I have done the instalation like this
    Copy win32com.dll to my <JDK>\bin directory.
    Copy comm.jar to my <JDK>\lib directory.
    Copy javax.comm.properties to my <JDK>\lib directory.
    and restart the system.
    But when i run the BlackBox , it is giving me message
    "serial port not found".
    Can any one tell me , what is the exact problem ?

    I'm not sure what you mean by BlackBox, but I have used the COMM api extensively.
    The majority of problems is that the api cannot see the serial port (which is what you are describing) and this is caused by incorrect placing of the javax.comm.properties file.
    As well as <JDK>\lib, try putting it into <JRE>\lib as well. That has often solved problems on my setup.

Maybe you are looking for

  • Sale Order Credit Block due to open credit memo

    Dear All, System is blocking sale order for open items(credit). And the only open item is credit memo. Can we avoid credit note to be considered as open item? Thanks Arun

  • Tomcat 4 on Linux

    I am trying to move a App from a Sun Installation to Linux for testing purposes. Very thing has been copy from the Sun Server, but I cant get the App to load, I keep getting the following error, any one any ideas, thanks 2005-10-18 11:46:43 StandardH

  • How to preserve XML comments in indesign cs4 document

    Hi, I have the below table xml with me: <?xml version="1.0" encoding="UTF-8"?> <informaltable xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid5:tablestyle="UNTABLE" aid:trows

  • PLS-00306: wrong number or types of arguments in call to 'START_COMMAND'

    I've got a package pkgrun with several procedures and when I compile the package I get the message: Warning: execution completed with warning PACKAGE BODY pkgrun Compiled. 44/7           PLS-00306: wrong number or types of arguments in call to 'START

  • MUSIC ALREADY ON HARD DRIVE

    How do I get iTunes to move it from my 2nd hard drive into iTunes. It will play through Windows Media Player but can't get it into iTunes!!!! HELP PLEASE !!!!!