Article View: comp.lang.pascal.misc
Article #123Re: What does INTR and GOTOXY keywords do?
From: Jared Showalter
Date: Wed, 28 Jan 1998 00:00
Date: Wed, 28 Jan 1998 00:00
62 lines
2603 bytes
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
Technical Details
Message-ID:
<34CFE7D7.A52806F3@home.NOSPAM.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<jchauvinEnGL1M.JHp@netcom.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10261c,eb48d5f0442c1ea8 X-Google-Attributes: gid10261c,public X-Google-Thread: 108ebd,eb48d5f0442c1ea8 X-Google-Attributes: gid108ebd,public From: Jared Showalter <jareds@home.NOSPAM.com> Subject: Re: What does INTR and GOTOXY keywords do? Date: 1998/01/28 Message-ID: <34CFE7D7.A52806F3@home.NOSPAM.com> X-Deja-AN: 320144731 Content-Transfer-Encoding: 7bit References: <jchauvinEnGL1M.JHp@netcom.com> Mime-Version: 1.0 To: "John H. Chauvin" <jchauvin@netcom.com> Content-Type: text/plain; charset=us-ascii Organization: @Home Network Newsgroups: comp.lang.pascal.misc,borland.public.turbopascal