🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.misc
8 messages
8 total messages Started by John H. Chauvin Tue, 27 Jan 1998 00:00
What does INTR and GOTOXY keywords do?
#124
Author: John H. Chauvin
Date: Tue, 27 Jan 1998 00:00
50 lines
1851 bytes
I recently obtained a old (early 1980s) Pascal program which was
originally written to work on a PC (most likely DOS). I am having
difficulty compiling the two functions listed below.
Specifically, the compiler does not understand the INTR and
GOTOXY keywords. Any idea what these do? If so, how can I
duplicate their function using CodeWarrior Pro 2 for Windows?

Thanks,

John Chauvin 


-------------------------------------------------------------
FUNCTION GETCHAR : CHAR;

TYPE    REGPACK = RECORD
                  AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : INTEGER;
                  END;

VAR     REGISTERS : REGPACK;
        C : CHAR;

BEGIN
C := CHR(0);
WHILE C = CHR(0) DO
      BEGIN
      REGISTERS.AX := 8*256;
      INTR(33,REGISTERS);              <=== What is INTR?
      C := CHR(REGISTERS.AX AND 255);
      END;
GETCHAR := C;
END; 
-------------------------------------------------------------

-------------------------------------------------------------
PROCEDURE CLEAR; 
VAR I : INTEGER;

BEGIN
FOR I := 1 TO 25 DO WRITELN;
GOTOXY(0,0);                         <==== What is GOTOXY?
END;      
-------------------------------------------------------------



-- 
John H. Chauvin jchauvin@netcom.COM
Netcom - Online Communication Services San Jose, CA
Re: What does INTR and GOTOXY keywords do?
#123
Author: Jared Showalter
Date: Wed, 28 Jan 1998 00:00
62 lines
2603 bytes
Intr calls an interrupt.  In this case, it calls interrupt 21h,
subfunction 8, which reads a key from standard input into register AL.
GotoXY positions the cursor on the screen, in this case at the top
left corner.

I would replace the function and procedure as a whole.  That is,
function GETCHAR returns the next keypressed, so find a function
in the CodeWarrior documentation to do that.  Similarly, find a
procedure to clear the window, as procedure CLEAR clears the
screen.

Jared Showalter

John H. Chauvin wrote:
> 
> I recently obtained a old (early 1980s) Pascal program which was
> originally written to work on a PC (most likely DOS). I am having
> difficulty compiling the two functions listed below.
> Specifically, the compiler does not understand the INTR and
> GOTOXY keywords. Any idea what these do? If so, how can I
> duplicate their function using CodeWarrior Pro 2 for Windows?
> 
> Thanks,
> 
> John Chauvin
> 
> -------------------------------------------------------------
> FUNCTION GETCHAR : CHAR;
> 
> TYPE    REGPACK = RECORD
>                   AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : INTEGER;
>                   END;
> 
> VAR     REGISTERS : REGPACK;
>         C : CHAR;
> 
> BEGIN
> C := CHR(0);
> WHILE C = CHR(0) DO
>       BEGIN
>       REGISTERS.AX := 8*256;
>       INTR(33,REGISTERS);              <=== What is INTR?
>       C := CHR(REGISTERS.AX AND 255);
>       END;
> GETCHAR := C;
> END;
> -------------------------------------------------------------
> 
> -------------------------------------------------------------
> PROCEDURE CLEAR;
> VAR I : INTEGER;
> 
> BEGIN
> FOR I := 1 TO 25 DO WRITELN;
> GOTOXY(0,0);                         <==== What is GOTOXY?
> END;
> -------------------------------------------------------------
> 
> --
> John H. Chauvin jchauvin@netcom.COM
> Netcom - Online Communication Services San Jose, CA
Re: What does INTR and GOTOXY keywords do?
#125
Author: Michael Day (TeamB)
Date: Wed, 28 Jan 1998 00:00
19 lines
1486 bytes
On Tue, 27 Jan 1998 20:03:22 GMT, jchauvin@netcom.com (John H. Chauvin) wrote:

>Specifically, the compiler does not understand the INTR and
>GOTOXY keywords. Any idea what these do? If so, how can I
>duplicate their function using CodeWarrior Pro 2 for Windows?

GOTOXY positions the text cursor on a MSDOS screen. It is only available to
MSDOS programs Since Windows don't have text screens, there is no text cursor
positioning command. 

The INTR is a call to the system bios It is available in Win31, but not in
32bit mode. You no longer have direct access to the bios in 32 bit windows.
Int33 is a call the mouse, and probably being used to obtain the mous position
on the screen. You would have to completely rewrite the code to use Windows
api calls, which are completely different than MSDOS calls. 

In other words, you can't duplicate the calls, you need to modify the code to
be compatible with the Windows methodology.
Re: What does INTR and GOTOXY keywords do?
#126
Author: Doug Lurie
Date: Wed, 28 Jan 1998 00:00
13 lines
1075 bytes
John H. Chauvin <jchauvin@netcom.com> wrote in article
<jchauvinEnGL1M.JHp@netcom.com>...

>       INTR(33,REGISTERS);              <=== What is INTR?
Use for DOS interrupts, not a good idea with Windows!
> GOTOXY(0,0);                         <==== What is GOTOXY?
Use for setting position in DOS TEXT window. X and Y are display
coordinates: upper left is X=1, Y=1 and lower right is typically X=80,
Y=25. GOTOXY( 0, 0 ) should produce an error condition because it is off
the screen.

Hope this helps, Doug.
Re: What does INTR and GOTOXY keywords do?
#127
Author: Diesel
Date: Wed, 28 Jan 1998 00:00
57 lines
2231 bytes
gotoxy(x:integer,y:integer);
is just like a moveto(x,y) but you just put where you want it moved to
its a crt unit and i think its for text mode not graphics

John H. Chauvin <jchauvin@netcom.com> wrote in article
<jchauvinEnGL1M.JHp@netcom.com>...
> I recently obtained a old (early 1980s) Pascal program which was
> originally written to work on a PC (most likely DOS). I am having
> difficulty compiling the two functions listed below.
> Specifically, the compiler does not understand the INTR and
> GOTOXY keywords. Any idea what these do? If so, how can I
> duplicate their function using CodeWarrior Pro 2 for Windows?
> 
> Thanks,
> 
> John Chauvin 
> 
> 
> -------------------------------------------------------------
> FUNCTION GETCHAR : CHAR;
> 
> TYPE    REGPACK = RECORD
>                   AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : INTEGER;
>                   END;
> 
> VAR     REGISTERS : REGPACK;
>         C : CHAR;
> 
> BEGIN
> C := CHR(0);
> WHILE C = CHR(0) DO
>       BEGIN
>       REGISTERS.AX := 8*256;
>       INTR(33,REGISTERS);              <=== What is INTR?
>       C := CHR(REGISTERS.AX AND 255);
>       END;
> GETCHAR := C;
> END; 
> -------------------------------------------------------------
> 
> -------------------------------------------------------------
> PROCEDURE CLEAR; 
> VAR I : INTEGER;
> 
> BEGIN
> FOR I := 1 TO 25 DO WRITELN;
> GOTOXY(0,0);                         <==== What is GOTOXY?
> END;      
> -------------------------------------------------------------
> 
> 
> 
> -- 
> John H. Chauvin jchauvin@netcom.COM
> Netcom - Online Communication Services San Jose, CA
> 
Re: What does INTR and GOTOXY keywords do?
#128
Author: Roman Gruber
Date: Wed, 28 Jan 1998 00:00
12 lines
1080 bytes
>> GOTOXY(0,0);                         <==== What is GOTOXY?
>Use for setting position in DOS TEXT window. X and Y are display
>coordinates: upper left is X=1, Y=1 and lower right is typically X=80,
>Y=25. GOTOXY( 0, 0 ) should produce an error condition because it is off
>the screen.

besides that, this function is propably the worst case (slowest way)
of an CLRSCR replacement I've ever seen! ;->
Roman Gruber
------------> gruberr@kapsch.net
"Every finished, working program is outdated"
Re: What does INTR and GOTOXY keywords do?
#129
Author: Odie Deth
Date: Wed, 28 Jan 1998 00:00
21 lines
1654 bytes
Earlier, mikeday@nospam.backwater.com (Michael Day (TeamB)) wrote:
>GOTOXY positions the text cursor on a MSDOS screen. It is only available to
>MSDOS programs Since Windows don't have text screens, there is no text cursor
>positioning command. 
Correct. I would suggest replacing the entire "clear" procedure with
clrscr, however.

>Int33 is a call the mouse, and probably being used to obtain the mous position
No. Int 33 hex, is a call to the mouse, but this is a call to int 33
dec (21 hex). This interrupt does a great number of different things
(ranging from system reboot to determining what time it is). I'm not
at all familiar with int 21h, but I find it quite odd that AX is set
to such a high value. Normally, the subfunction number of the called
interrupt is stored in AL, and AX is set to 0. But, as I said, I
really don't know diddelysquat about int 21h (33).

I hope you got something useful from this admittedly non-informative
posting. Oh, well, you can't get it right every time.
---
Odie Deth  -  odie@algonet.se  -  http://www.algonet.se/~odie
Re: What does INTR and GOTOXY keywords do?
#130
Author: Odie Deth
Date: Wed, 28 Jan 1998 00:00
6 lines
837 bytes
Earlier, odie@algonet.se.REMOVE (Odie Deth) wrote:
>interrupt is stored in AL, and AX is set to 0. But, as I said, I
Oops, sorry: AH is set to 0, of course. :-)
---
Odie Deth  -  odie@algonet.se  -  http://www.algonet.se/~odie
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads