Proper invoking .COM file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sukatoa
    Contributor
    • Nov 2007
    • 539

    Proper invoking .COM file

    A86 code (Assembly)

    jmp main

    main:
    mov ah,0h ;Service 0, Captures the input and stores it to register al...
    int 16h ; Interrupt 16 BIOS...

    mov ah,2h ;Service 2
    mov dl,al ;Copy register al to register dl
    int 21h ;interrupt 21, prints the character
    jmp exit ;goto exit
    ;end main

    exit:
    mov ah,0h ;equivalent getch in C
    int 16H ;
    int 20H ;equivalent System.exit(0) in java


    the code above is a A86 code that waits for an input from the user
    and prints what the user entered...

    the .COM file is the generated file after compiling the code, like executable file in windows....A DOS program....

    I've tried to invoke the .COM file using

    Asumming the .COM filename is INPUT.COM
    Runtime.getRunt ime().exec("cmd /C start INPUT.COM");

    It invokes the .COM file, but the expected flow doesn't prints what the user entered... Until terminated...

    When i just double clicked the .COM file, im satisfied with the flow....

    What is the proper invoking of this .COM file?

    Any reply will be appreciated...

    Sukatoa...
  • sukatoa
    Contributor
    • Nov 2007
    • 539

    #2
    If you were to implement this,

    How would you invoke the .COM file from java?

    Any reply would be appreciated

    Help needing,
    Sukatoa

    Comment

    Working...