Wednesday, February 6, 2019

CURSORDM

Table of Contents ] [ List of Example Programs ] [ CURSORDM Disk Image ]

CURSORDM is a very short program that appears on page 31 of the book Pascal Primer by David Fox and Mitchell Waite, demonstrating cursor control using the GOTOXY statement in UCSD Pascal on the Apple II


The Atari Pascal Language System doesn't have a GOTOXY statement, but it does have a POSITION statement.

By default, the Atari 8-bit computer indents two space when outputting to the screen, leaving us room for only 38 characters. There are ways to remove the 'two space indent', but for now, the POSITION statement will do fix it for us.

I  added a WRITE(CHR(125)) to CLEAR the text screen before displaying any of the other program output.

For the two position statements that place the cursor on line 23, I adjusted them to put the cursor on line 22 instead. This keeps the program from scrolling the first two lines up, off the top of the screen.

To keep the program from just ending and returning to the Atari DOS 2.0S menu, I added a READLN(S) statement, so that it was for the user to press ENTER/RETURN.


I'm developing and running the code using the Altirra 3.10 Atari 8-bit emulator. I'm editing the code using AtariWriter 80 (AtariWriter80_b_XE-working.ATR). Note that if you use AtariWriter to edited your source code, you will need to use CONTROL+S to save your file in straight ASCII rather than the SAVE Menu option which includes some AtariWriter header info. I'm compiling, linking, running the program using the Atari Pascal Language System.

The link command looks like:

LINKER V1.0
*D2:CURSORDM.ERL,GRSND,PASLIB/S

When you run the program, it looks like: 


No comments:

Post a Comment