Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1 View

Intel Visual Fortran V8.1 Compiler for windows 8.0

Jump to solution

Hi,

My name is D.SundarChand from Hyderabad,Telangana,India.Originally,I have developed in MS-DOS Fortran 5.0 in 1983.After that I am busy with my Jobs.Now,I am a retired person.That is why I want to update that softwares in to Windows/Visual Fortran environment.I am facing trouble at the time of linking,call color, the below main routine and subroutine color routine from MSFLIB.F90 in the visual Studio Environment of Intel Visual Fortran 8.1 & Microsoft Fortran PowerStation 4.0 the color routine not working and it displays unresolved external symbols _bkcolor,_textcolor. Object file not created due to these 2 errors. How can I solve this problem?I tried in so many ways.but not succeeded.Please help me in this matter at the earliest.I have already developed interface to MS-DOS 5.0 Assembly Language routines to Fortran.But in that also object file not created.Because they are in MS-DOS Assembler 5.0.Only these 2 problems are pending.In assembler it is indicating no errors.but object file not created on windows 8.0 version.

How to resolve these 2 troubles?

I.1.FORTRAN MAIN PROGRAM 

      CALL SETTEXTPOSITION (9,6,XY)

      CALL COLOR (#000000,#00ff00)

      CALL OUTTEXT('Year')

      CALL COLOR (#000000,#00ff00)

      CALL SETTEXTPOSITION (9,48,XY)

      CALL COLOR (#00ff00,#000000)

      CALL OUTTEXT('    ')

      READ (*,010)      YB

 010  FORMAT(I4)

          END

2.FORTRAN SUBROUTINE 

      SUBROUTINE COLOR (K,L)

      USE MSFLIB

      J=SETBKCOLOR(K)

      I=SETTEXTCOLOR(L)

      RETURN

      END

 

Kindly let me know the fault in the Main Program and Subroutine and their corrections.

 

II.1.CURSIZ.ASM
Data    Segment Public 'DATA'
Data    EndS
DGROUP  GROUP Data
Code    Segment 'CODE'
        Assume Cs:Code, Ds:DGROUP, Ss:DGROUP
PUBLIC  CURSIZ
CURSIZ  Proc   Far
        Push Bp
        Mov    Bp, Sp
        Mov Ah, 1
        Les     bx, DWord Ptr [Bp + 10]
        Mov ECH, Es:[Ebx]
        Les     bx, DWord Ptr [Bp + 06]
        Mov ECL, Es:[Ebx]
        Int
        Mov Sp, Bp
        Pop    Bp
        Ret 08
        CURSIZ  EndP
        Code   EndS
End

2.KEY.ASM 

DATA    SEGMENT PUBLIC 'DATA'
DATA    ENDS
DGROUP  GROUP DATA
CODE    SEGMENT 'CODE'
        ASSUME CS:CODE,DS:DGROUP,SS:DGROUP
PUBLIC  KEY 
KEY     PROC   FAR
        PUSH   BP
        MOV    BP,SP
        MOV    AH,0
        INT    
        LES    BX,DWORD PTR[BP+10]
        MOV    ES:[EBX],AH
        LES    BX,DWORD PTR[BP+06]
        MOV    ES:[EBX],AL
        MOV    SP,BP
        POP    BP
        RET    08
        KEY    ENDP
        CODE   ENDS
END

Kindly let me know the fault in the .ASM routines and their corrections.

 

Thanks,

 

with regards,

D.SundarChand

+091-8688568699

sunderchand1957@gmail.com

0 Kudos

Accepted Solutions
Highlighted
Valued Contributor II
1 View

I am guessing that this

Jump to solution

I am guessing that this application had a user interface where you put some text of the screen and get keypresses to pick a 'menu' option maybe or intercept the arrow keys to navigate a 'menu'? I clearly know nothing about you application and what the user interface needs to do but my suggestion to you is to build some of the QuickWin examples that come with Fortran and see if any of them have a user interface that can be easily modified to suit your application. It might be  a lot easier than you think and will give a much more modern look and feel.  

View solution in original post

0 Kudos
21 Replies
Highlighted
Beginner
1 View

Please let me know the

Jump to solution

Please let me know the solution at the earliest.

Thnx

 

with regards,

D.SundarChand

+918688568699

sunderchand1957@gmail.com

 

 

0 Kudos
Highlighted
Black Belt
1 View

I can't help with the

Jump to solution

I can't help with the assembler, but if you add USE MSFLIB to the main program, as you have it in the subroutine, that will help. You are using a VERY old compiler, from 2006 or so, and I can't predict what other issues you may find.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Black Belt
1 View

Your Microsoft Fortran

Jump to solution

Your Microsoft Fortran programs were written for MSDOS, a 16-bit OS. You will need to port them to 32 or 64 bit Windows. Assembly code written for 16-bit CPUs cannot be used in recent versions of 32-bit or 64-bit Windows. Some integer arguments to Quickwin routines may need to be surrounded by INT2(). Given all these roadblocks, you may wish to consider rewriting your example code from scratch or by using the example programs furnished with your compiler as templates.

Here is a modified version of your Fortran code that works with CVF6.6C and IFort 17.0.4. The two compilers that you listed (IFort 8.1 and Powerstation 4) had many bugs and you would do well to use a different compiler. As Steve said, these are both old compilers.

       program tsun
       USE MSFLIB
       TYPE (rccoord) XY
       CALL SETTEXTPOSITION (int2(9),int2(6),XY)
       CALL COLOR (#000000,#00ff00)
       CALL OUTTEXT('Year')
       CALL COLOR (#000000,#00ff00)
       CALL SETTEXTPOSITION (9,48,XY)
       CALL COLOR (#00ff00,#00FF00)
       CALL OUTTEXT('2017')
       READ (*,010) IYB
   10  FORMAT(I4)
       END

       SUBROUTINE COLOR (K,L)
       USE MSFLIB
       J=SETBKCOLOR(K)
       I=SETTEXTCOLOR(int2(L))
       RETURN
       END

This example does not use the routines that are provided in your 16-bit assembler codes. Those routines contain invalid 16-bit code: there are no registers called ECH or ECL, and you cannot use 32-bit registers in R/M expressions in 16-bit code. Are these assembly codes the results of attempts to convert 16-bit code to 32-bit code?

0 Kudos
Highlighted
Beginner
1 View

A lot of thanks for your fast

Jump to solution

A lot of thanks for your fast and kind help. After modified source as per your help, at the time of linking, and it is not working,giving the below errors :

tsun.obj: error LNK2001: unresolved external symbol __setbkcolor

tsun.obj: error LNK2001: unresolved external symbol __settextcolor

tsun.exe: fatal error LNK1120: 2 unresolved externals

Error executing link.exe.

tsun.exe - 3 error(s)

 

USE MSFLIB

TYPE (rccoord) XY

CALL SETTEXTPOSITION (int2(9),int2(6),XY)

CALL COLOR (#000000,#00ff00)

CALL OUTTEXT('Year')

CALL COLOR (#000000,#00ff00)

CALL SETTEXTPOSITION (9,48,XY)

CALL COLOR (#00ff00,#00FF00)

CALL OUTTEXT('2017')

READ (*,010) YB

010 FORMAT(I4)

END

 

SUBROUTINE COLOR (K,L)

USE MSFLIB

J=SETBKCOLOR(K)

I=SETTEXTCOLOR(int2(L))

RETURN

END

It is tested on Intel Visual Fortran Compiler V8.1 Version above codes.

These 2  Assembly codes in 16 Bit trying to convert into 32 Bit 

0 Kudos
Highlighted
Black Belt
1 View

You need the /libs:qwin

Jump to solution

You need the /libs:qwin option:

   ifort /libs:qwin tsun.f

There is no feasible way of converting 16-bit assembly code that makes Int 21H and similar MSDOS system calls.

0 Kudos
Highlighted
Beginner
1 View

Thousand of thanks for your

Jump to solution

Thousand of thanks for your fast and kind help.If possible,I want to start a Fortran consultancy in the coming 3/4 months.I am trying for outsourcing work.If you favor me that is great help  to me.I don't want to be idle in the future,that is why I am trying for outsourcing work.Before leaves the current body I want to do something useful to others.I am in the spiritual line.I know homeopathy,Astrology,Astronomy,Yoga,scriptures.Frequently delivering lectures on all the above topics to interested people.

Thnx

with warm regards,

sundarchand

 

 

0 Kudos
Highlighted
Beginner
1 View

The 2 assembly routines

Jump to solution

The 2 assembly routines (CURSIZ.ASM,KEY.ASM) of 16 Bit programs developed in 1983.Now I want to convert in to 32 Bit routines.I have no recent knowledge on assembly language.I am sending original routines developed in 1983 with this message.If possible these 2 modified routines available to me, I want to modify other routines also.It is also learning the new techniques as fast as possible like the fortran programs(tsun) through your help.It is confusing me the 486 programs.The 2 routines (CURSIZ.ASM,KEY.ASM) I tried my best to convert in to 32 Bit .but not correct I know.Some help required to modify.Really you helped me a lot about the Fortran routines.Quickly I learned through your help.I also modified my other programs fastly and easily.This is happened due to a gap  of 34 years.If I am restarting I will catch the techniques fast and easily.   

1.KEY.ASM-16 Bit

DATA Segment Public 'DATA'
DATA EndS
DGROUP  GROUP DATA
CODE Segment 'CODE'
     Assume Cs:CODE, Ds:DGROUP, Ss:DGROUP
Public KEY
KEY Proc Far
    Push Bp
    Mov Bp, Sp
    Mov Ah, 0
    Int
    Les Bx, DWord Ptr [Bp + 10]
    Mov Es:[bx], Ah
    Les Bx, DWord Ptr [Bp + 06]
    Mov Es:[bx], Al
    Mov Sp, Bp
    Pop Bp
    Ret 08
KEY EndP
    CODE EndS
End
Main EndP
End start

2.CURSIZ.ASM-16 Bit 

Data    Segment Public 'DATA'
Data    EndS
DGROUP  GROUP Data
Code    Segment 'CODE'
        Assume Cs:Code, Ds:DGROUP, Ss:DGROUP
Public  CURSIZ
CURSIZ  Proc   Far
        Push Bp
        Mov    Bp, Sp
        Mov Ah, 1
        Les     bx, DWord Ptr [Bp + 10]
        Mov CH, Es:[bx]
        Les     bx, DWord Ptr [Bp + 06]
        Mov CL, Es:[bx]
        Int
        Mov Sp, Bp
        Pop    Bp
        Ret 08
CURSIZ  EndP
        Code   EndS
End

Main EndP

End start

Once again thousands of thanks for your kind help.

Thnx

 

with warm regards,

D.SundarChand

 

 

0 Kudos
Highlighted
Valued Contributor II
1 View

why use ASM at all, is it

Jump to solution

why use ASM at all, is it actually necessary?

0 Kudos
Highlighted
Black Belt
1 View

Do you know what these

Jump to solution

Do you know what these assembler routines do? My guess is that you don't. From their names I might speculate that they do something like capturing keypresses or doing something with the cursor. It is very likely that you cannot use assembler for these purposes in modern Windows. If you know what they are used for (since they are not referenced in the Fortran code you showed us), we may be able to suggest existing library routines that will be suitable replacements.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
1 View

Steve Guruji(aka "Doctor

Jump to solution

Namaste (aka “DOCTOR FORTRAN”) Guruji!

I have already searched for this routines as per your guidance in QWIN.LIB. Only cursor display routine available. But Cursor size and Key routines not available. My software developed in MS DOS FORTRAN 5.0 interface with MS DOS ASSEMBLER 5.0 in 1983 of 16 Bit as a menu driven Software. At that time cursiz, key functions are not available in FORTRAN language. I have developed personally so many assembler interfaces(Given below for your ready reference) to develop my astronomical packages. My Self-learned languages Assembler and FORTRAN without any one guidance. Below given my Assembler routines (ASM=Total 32). 

TIME,SOUND,SIREN,SETDSKTY,SCRLUP,SCRLDN,SCREEN,RST,RSET,RESET,PRNT,PIXEL,MEDIATYP,MD,KEY,GETDRTYP,FRMAT,FDSKTBL,FDSASM,EQPINV,DSKUT,DSKTYP,DSKTY,DSKTBL,DSKT,DSKSPACE,DSKCHNG,DRVRDY,CRDRV,CLS,CHECKDR,CD=32.

If the above routines were available in FORTRAN, it is a boon to me. Otherwise, it is a curse to me .Is there any Assembler key code charts available like 32 Bit Assembly Color code chart (BLACK=#000000)? I don’t want normal scan codes like ESC =27 like that.

Sorry I am troubling you. Now you are a retired person. I forgot this point. If possible, help me in this matter.If possible any one giving these 2 ASSEMBLER routines with 32 Bit it is a boon for me.I want to study and learn through your guidance of these 2 ASSEMBLER routines at the earliest

 

Thanks,

with regards,

D.SundarChand

+091-8688568699

sunderchand1957@gmail.com

0 Kudos
Highlighted
Valued Contributor II
2 Views

I am guessing that this

Jump to solution

I am guessing that this application had a user interface where you put some text of the screen and get keypresses to pick a 'menu' option maybe or intercept the arrow keys to navigate a 'menu'? I clearly know nothing about you application and what the user interface needs to do but my suggestion to you is to build some of the QuickWin examples that come with Fortran and see if any of them have a user interface that can be easily modified to suit your application. It might be  a lot easier than you think and will give a much more modern look and feel.  

View solution in original post

0 Kudos
Highlighted
Black Belt
1 View

Unlike in DOS, you can't do

Jump to solution

Unlike in DOS, you can't do things such as key capture in assembler. Since you are already using QuickWin, you can use library routines such as INCHARQQ to read single characters. I am not sure what you are looking for regarding the cursor, but you may want to look through the lists of QuickWin and graphics routines here (Language Reference > Run-Time Library Routines), as well as this guide to developing Windows applications.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
1 View

Brother Andrew, Namaste!

Jump to solution

Brother Andrew, Namaste!

Thanks for your fast and quick help.

Exactly, you are 100% correct. That is a menu driven software developed in the year 1983 in MS-DOS FORTRAN 5.0 interface with MS-DOS Assembler 5.0 Environments for the usage of Astronomy to navigate a menu. Now running on MS WINDOWS 8.0 of 16 Bit.

I have already searched for this routines as per your guidance in QWIN.LIB. Only cursor display routine available. But Cursor size and Key routines not available. At that time in 1983, cursiz, key functions are not available in FORTRAN language. I have developed personally so many assembler interfaces (Given below for your ready reference) to develop my astronomical packages. My Self-learned languages Assembler and FORTRAN without any one guidance. Below given my Assembler routines (ASM=Total 32). 

TIME,SOUND,SIREN,SETDSKTY,SCRLUP,SCRLDN,SCREEN,RST,RSET,RESET,PRNT,PIXEL,MEDIATYP,MD,KEY,GETDRTYP,FRMAT,FDSKTBL,FDSASM,EQPINV,DSKUT,DSKTYP,DSKTY,DSKTBL,DSKT,DSKSPACE,DSKCHNG,DRVRDY,CRDRV,CLS,CHECKDR,CD=32.

If the above 32 routines, any routine is available readily in FORTRAN.LIB, it is a boon to me. Otherwise, it is a curse to me .Is there any Assembler key code charts available like 32 Bit Assembly Color code chart (BLACK=#000000)? I don’t want normal scan codes like ESC =27 like that.

Sorry I am troubling you. If possible, help me in this matter at the earliest. If possible, please send the required 2 ASM routines. I want to study and learn Modern ASSEMBLER through your guidance of the 2 ASSEMBLER routines.   

II.1.CURSIZ.ASM
Data    Segment Public 'DATA'
Data    EndS
DGROUP GROUP Data
Code    Segment 'CODE'
        Assume Cs: Code, Ds: DGROUP, Ss: DGROUP
PUBLIC  CURSIZ
CURSIZ        Proc   Far
        Push     Bp
        Mov      Bp, Sp
        Mov       Ah, 1
        Les        bx, DWord Ptr [Bp + 10]
        Mov       CH, Es:[bx]
        Les        bx, DWord Ptr [Bp + 06]
        Mov       CL, Es:[bx]
        Int
        Mov       Sp, Bp
        Pop        Bp
        Ret         08
        CURSIZ  EndP
        Code      EndS
End

2.KEY.ASM 

DATA    SEGMENT PUBLIC 'DATA'
DATA    ENDS
DGROUP  GROUP DATA
CODE    SEGMENT 'CODE'
        ASSUME CS:CODE,DS:DGROUP,SS:DGROUP
PUBLIC  KEY 
KEY     PROC   FAR
        PUSH   BP
        MOV     BP,SP
        MOV     AH,0
        INT    
        LES       BX,DWORD PTR[BP+10]
        MOV     ES:[BX],AH
        LES      BX,DWORD PTR[BP+06]
        MOV     ES:[BX],AL
        MOV    SP,BP
        POP     BP
        RET     08
        KEY     ENDP
        CODE   ENDS
END

 

Thanks,

with regards,

D.SundarChand

+091-8688568699

sunderchand1957@gmail.com

0 Kudos
Highlighted
Beginner
1 View

 

 

 

 

 

 

 

 

 

 

 

 

A lot of thanks for your fast and kind help. After modified source as per your help, at the time of running the exe file, giving run-time error F6998: QWIN. Displayed the message on the monitor is ”–using quick win is illegal in console application”. Calling SETTEXTCOLOR, SETBKCOLOR routines from QWIN.LIB, it is giving the above error. Now it is running on MS WINDOWS 8.0.It is not possible to enter input data. If I am invoking the exe file, immediately it is giving the above error. How can I solve this error? Please guide me at the earliest. All other errors are cleared with your guidance. 

I.1.FORTRAN MAIN PROGRAM 

       CALL SETTEXTPOSITION (INT2 (9), INT2 (6), XY)

      CALL COLOR (#000000, #00ff00)

      CALL OUTTEXT ('Year')

      CALL COLOR (#000000, #00ff00)

      CALL SETTEXTPOSITION (9, 48, XY)

      CALL COLOR (#00ff00, #000000)

      CALL OUTTEXT ('    ')

      READ (*, 010)      YB

 010 FORMAT (I4)

          END

2. FORTRAN SUBROUTINE 

      SUBROUTINE COLOR (K, L)

      USE MSFLIB

      INTEGER (2) I

      INTEGER (4) J

      J=SETBKCOLOR (K)

      I=SETTEXTCOLOR (INT2 (L))

      RETURN

      END

0 Kudos
Highlighted
Valued Contributor II
1 View

Your linker properties have

Jump to solution

Your linker properties have Console (/SUBSYSTEM:CONSOLE) a quickwin application cannot be a console app,  it needs to be /SUBSYSTEM:WINDOWS. In the fortran properties page you also need QuickWin (/libs:qwin)

0 Kudos
Highlighted
Beginner
1 View

Brother Andrew, Namaste!

Jump to solution

Brother Andrew, Namaste!

Thanks for your fast and quick help. Visited the build settings menu in the compiler and entered in the link menu /subsystem: console & /subsystem: windows. I am using currently Windows 8.0 for  MicroSoft FortranPowerStation 4.0.

I tried as per your guidance, but giving below 2 errors, 1 warning.

1. Internal Error-unexpected error

File “qwin\qwgraph\qwgutil.c”, line 1699.

2. After modified source as per your help note, at the time of running the .exe file, giving run-time error F6998: QWIN. Displayed the message on the monitor is”–using quick win is illegal in console application”.

3. Linking...

LINK: warning LNK4010: invalid version number /SUBSYSTEM: WINDOWS, /QWIN; default version assumed

tsun.exe - 0 error(s), 1 warning(s)

I am not worrying about the warning in above point 3.

4. As per your help note, in the FORTRAN properties page you also need quick win (/libs: qwin). I can’t find, where it is available? One properties menu available in Edit menu. Is it that? But it is source window properties.

 

What can I do?

Thanks,

With regards,

D.SundarChand

+091-8688568699

sunderchand1957@gmail.com     .

0 Kudos
Highlighted
Valued Contributor II
1 View

read the quickwin sections in

Jump to solution

read the quickwin sections in https://software.intel.com/sites/default/files/Creating_Fortran_Win_Apps_0.pdf

 

0 Kudos
Highlighted
Black Belt
1 View

You're using Powerstation?!?

Jump to solution

You're using Powerstation?!?

For QuickWin applications, you must use /subsystem:windows in the linker options. /libs:qwin goes in the compiler options.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
1 View

 

 

 

 

 

 

 

 

Namaste,Guruji!

Thanks for your fast and quick help. Visited the build settings menu in the compiler and entered in the link menu /subsystem: console & /subsystem: windows. I am using currently Windows 8.0 for  MicroSoft FortranPowerStation 4.0.

I tried as per your guidance, but giving below 2 errors, 1 warning.

1. Internal Error-unexpected error

File “qwin\qwgraph\qwgutil.c”, line 1699.

2. After modified source as per your help note, at the time of running the .exe file, giving run-time error F6998: QWIN. Displayed the message on the monitor is”–using quick win is illegal in console application”.

3. Linking...

LINK: warning LNK4010: invalid version number /SUBSYSTEM: WINDOWS, /QWIN; default version assumed

tsun.exe - 0 error(s), 1 warning(s)

I am not worrying about the warning in above point 3.

 

What can I do?

Thanks,

With regards,

D.SundarChand

+091-8688568699

sunderchand1957@gmail.com     .

0 Kudos