[Coco] Question on MINTED internals

Neal Crook foofoobedoo at gmail.com
Wed Dec 23 18:32:07 EST 2015


Here's my contribution towards raising the technical tone of the
conversation...

I am working on a port of Luis Antoniosi's MINTED editor to produce a
version that uses ANSI control sequences. The idea is that it would work
across an rs232 link from a terminal emulator to a real Coco or (and more
importantly for me) work on a virtual terminal on my NitrOS9 multicomp
system.

Here's a fragment of the original source code (I added the line numbers for
reference):

1: _rename     pshs    a,b,x,y
2: @repeat     clra
3:             ldb     <height+1
4:             decb
5:             lbsr    _gotoxy
6:             lbsr    _clrlin
7:             ldb     <height+1
8:             lbsr    _gotoxy
9:             lbsr    _clrlin

Assume that the output device is 80 col by 25 row and the height is stored
as a 16-bit value, so
that line 3 loads "25" into B.

The call in line 5 has A=0, B=24
The call in line 8 has A=0 (assuming A is preserved), B=25

Questions:

1/ why not do this:

1: _rename     pshs    a,b,x,y
2: @repeat     clra
3:             ldb     <height+1
4:
5:             lbsr    _gotoxy
6:             lbsr    _clrlin
7:             decb
8:             lbsr    _gotoxy
9:             lbsr    _clrlin

2/ is the corner of the screen 0,0 or 1,1 (or something else? I'm puzzled
by the A=0, B=25 which seems contradictory)

3/ is the corner (0,0 or whatever) the top-left corner or some other corner?

(For reference, an ANSI screen has the top-left corner as 1,1)

Thanks in advance for any enlightenment

Neal.


More information about the Coco mailing list