Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #5342

Re: Text windows in Apple Pascal?

From Fred Smith <fred@thejanitor.corp>
Newsgroups comp.sys.apple2.programmer
Subject Re: Text windows in Apple Pascal?
Date 2019-12-28 01:08 +0000
Organization Janitor Corp.
Message-ID <qu69va$1l5j$1@gioia.aioe.org> (permalink)
References <ab50e9e8-7f7a-4617-82b2-977a1e0b5a45@googlegroups.com>

Show all headers | View raw


On 2019-12-27, Paul MacMillan <paul.s.macmillan@gmail.com> wrote:
> Hi, is there an easy way to get text window functionality in Apple Pascal, similar to POKE
> 32  (etc.) in Applesoft?  I tried POKEing but the builtin WRITE/WRITELN seems to not care 
> what I have poked. I am not adverse to a little assembly language (especially with the 
> very capable Apple Pascal Assembler) but don't want to re-invent the wheel if its already 
> available. 
>
> Thanks,
> Paul

Never tried, but I seem to recall that the low addresses are used for pascal
interpreter variables (for speed), so "text window" functionality may simply not exist.
You can write peek and poke in Apple Pascal using variant records.

type
  byte = 0..255;
  membyte = packed array [0..0] of byte;
  location = record case boolean of
    true : (addr : integer);
    false : (ptr : ^membyte)
  end;

procedure poke(address : integer;
               value : byte);
var
  loc : location;
begin
  loc.addr := address;
  loc.ptr^[0] := value
end;

function peek(address : integer) : byte;
var
  loc : location;
begin
  loc.addr := address;
  peek := loc.ptr^[0]
end;


Try to get a copy of Randall Hyde's "p-Source" book to learn about Apple Pascal
internals, there used to be a copy floating around on the net.

Back to comp.sys.apple2.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Text windows in Apple Pascal? Paul MacMillan <paul.s.macmillan@gmail.com> - 2019-12-27 15:05 -0800
  Re: Text windows in Apple Pascal? Fred Smith <fred@thejanitor.corp> - 2019-12-28 01:08 +0000
    Re: Text windows in Apple Pascal? Paul MacMillan <paul.s.macmillan@gmail.com> - 2019-12-27 18:51 -0800
  Re: Text windows in Apple Pascal? David Schmenk <dschmenk@gmail.com> - 2019-12-27 20:02 -0800
  Text windows in Apple Pascal? gids.rs@sasktel.net - 2019-12-27 20:33 -0800
  Re: Text windows in Apple Pascal? awanderin <awanderin@gmail.com> - 2019-12-27 23:17 -0700
  Re: Text windows in Apple Pascal? Marco Verpelli <mverpelli@libero.it> - 2019-12-31 05:52 -0800

csiph-web