By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

Need advice!!!

100+
P: 539
I currently developing a simple notepad that could compile A86 codes using java.... Im using Windows XP SP2....

When @ compile, i am satisfied with the result...

When i try to invoke the .COM file from java, the problem occured...

my a86 simple program that waits and accept a character input from the keyboard and print it directly then next keypress terminates...

////////////////////////////////////////////ASM CODE//////////////////////////////////////////////////
jmp main

main:
mov ah, 0h ;responsible for capturing keyboard inputs
int 16h

mov ah,02h ;responsible for displaying the character inputted..
mov dl, al
jmp exit:

exit:
mov ah,0h ;equivalent getch in C...
int 16h
int 20h
////////////////////////////////////////////END CODE//////////////////////////////////////////////////

after compile, the .COM file generated,

When i just invoke the .COM file by just using mouse (double clicking on it)...
It runs actually
waits any keyboard input, after input, it directly prints the character...
then terminated after any following keyboard press...

here's my problem,

but when i try to invoke it using Java...
Runtime.getRuntime().exec("cmd /C start TEMPNAME.COM");
assuming TEMPNAME is the filename...

It executes actually, but it stays in freeze state until the 2nd input then terminated...

i mean, at the real flow, it waits for a character, when i press 'a', then prints the 'a' character then pressing any key to exit...

but in invoking through java, it waits, when i press 'a', it doesn't print, next input then terminates...

actually i invoke the CMD, and the CMD would do the process...to invoke the .COM file...

does the way i invoke the CMD is wrong?
Can you advice me with the "cmd /C start TEMPNAME.COM"?if it is wrong?
or get doubt? or suspected?
is "/C start TEMPNAME.COM" is a proper invoking pattern in MSDOS?
Thus any other way/alternative for this?

I suspect this code "cmd /C start TEMPNAME.COM"......

because, i have a subject now ASSEMBLY, i feel tired like using DOS to do the task, like compiling and invoking on it (edit temp.asm, a86 temp.asm, temp.com) like that in DOS...

in JAVA forum, nobody could try to answer this similar thread there...
Im hoping that in this forum, i might get the right way to the solution...

I really like to distribute this notepad if it works 100%...
Please help me...

A solid WINDOWS user,
Sukatoa... Thanks in advance....
Feb 24 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.