|
|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 16896 (0x4200)
Types: TextFile
Names: »termiotxt «
└─⟦9ccaf6601⟧ Bits:30008165 Bånd med SW8000 kildetekst/release værktøjer
└─⟦f546e193b⟧
└─⟦this⟧ »termiotxt «
<*************************************************************************>
<* Terminal i/o procedures used by mcl simulator test version *>
<*************************************************************************>
<*************************************************************************>
<* Revision history *>
<* Archived 85.12.13 as termiotxt.01 on rcmenu-ark-001 *>
<* *>
<*-----------------------------------------------------------------------*>
<* 85.12.13 Version can only be used by rc855 tty simulator *>
<*************************************************************************>
integer procedure read_text(z,dest,pos,length);
<*************************************************************************>
<* Read a text string into an array from a document used as a terminal *>
<* *>
<* z (call) : Document used as a terminal; *>
<* dest (call) : The text string is inserted into this array. *>
<* Characters before and after the inserted are not *>
<* changed. *>
<* pos (call) : As call value pos denotes the character position *>
<* into which the first read charecter is to be *>
<* inserted. *>
<* pos (ret) : The return value denotes the character *>
<* position after the last inserted character. *>
<* length (call) : The length parameter controls the reading in the *>
<* following way: *>
<* length=0 : Characters are read until dist are full *>
<* or a character with class>=8 are read. *>
<* The terminator (class>=8) aren't inserted*>
<* length>0 : Exactly length characters are read. *>
<* length<0 : At most abs length characters are read *>
<* The reading are stoped if a character *>
<* with class>=8 is read. *>
<* The terminator (class>=8) aren't inserted*>
<* length (ret) : At return the value of length is the number of *>
<* characters inserted into dest. *>
<* Length is negativ if dest is full. *>
<* *>
<* read_text (ret): Returns the last character read. If dest is not full *>
<* this is the terminator else it is the last read *>
<* character. If length >0 it is inserted else it's not.*>
<* Returned as class shift 12 + value. *>
<*************************************************************************>
zone z;
long array dest;
integer pos,length;
begin
integer first_pos,class,ch,count;
boolean dest_full;
first_pos:=pos;
dest_full:=false;
class:=read_char(z,ch);
if length=0 then
begin
while class<8 and -,dest_full do
begin
dest_full:=put_char(dest,pos,ch,1)=-1;
class:=read_char(z,ch);
end;
end
else
if length>0 then
begin
for count:=1 step 1 until length do
begin
if put_char(dest,pos,ch,1)=-1 then
begin
dest_full:=true;
count:=length+1;
end;
class:=read_char(z,ch);
end;
end
else
begin
count:=1;
while (class<8) and (count<=(abs length)) and -,dest_full do
begin
dest_full:=put_char(dest,pos,ch,1)=-1;
count:=count+1;
class:=read_char(z,ch);
end;
end;
length:=pos-first_pos;
if dest_full then
begin
length:=-length;
end;
read_text:=class shift 12 + ch;
clear_zone(z);
end;
procedure clear_zone(z);
<* Clear the given (input) zone *>
zone z;
begin
integer array zone_dec(1:20);
getzone6(z,zone_dec);
zone_dec(12):=1 shift 16;
zone_dec(14):=zone_dec(15):=zone_dec(19);
setzone(z,zone_dec);
end;
integer procedure screen_info(column,line,screen_type);
<**************************************************************************>
<* screen_info (return, integer) : Available terminal functions. Bit: *>
<* clear_end_screen 0 *>
<* clear_end_line 1 *>
<* *>
<* column (return, integer) : Number of column's on line *>
<* line (return, integer) : Number of lines on screen *>
<* screen_type (return, integer) : Screen function descreption. Bit: *>
<* Scroll on last line 0 *>
<* *>
<**************************************************************************>
integer column,line,screen_type;
begin
column:=80;
line:=23;
end;
procedure terminal_intable(alpha);
<**************************************************************************>
<* alpha (return, integer array(0:127) ) : *>
<* Generates array to be used by intable with the following content: *>
<* *>
<* Class Value *>
<* Nul character 0 0 *>
<* Control characters 8 1 to 31 *>
<* except the following values returned if the key is pressed *>
<* Return key 8 13 *>
<* Cursor up key 9 11 *>
<* Cursor down key 9 10 *>
<* Cursor left key 9 8 *>
<* Cursor right key 9 9 *>
<* Home key 10 12 *>
<* Cancel key 11 24 *>
<* *>
<* Letters ect. 6 32 to 126 *>
<* Delete key 12 127 *>
<**************************************************************************>
integer array alpha;
begin
integer ii;
alpha(0):=0;
for ii:=1 step 1 until 31 do
alpha(ii):=8 shift 12 + ii;
alpha(5):=11 shift 12 + 24;
alpha(8):=9 shift 12 + 8;
alpha(10):=9 shift 12 + 10;
alpha(13):=8 shift 12 + 13;
alpha(24):=9 shift 12 + 9;
alpha(26):=9 shift 12 + 11;
alpha(29):=10 shift 12 + 12;
alpha(127):=12 shift 12 + 127;
for ii:=32 step 1 until 126 do
alpha(ii):=6 shift 12 + ii;
end;
procedure amx_table(z,table);
<**************************************************************************>
<* Set convert table number in amx driver in 3600 front end *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<* table (call) : The convert tabel number to be used *>
<**************************************************************************>
value table;
zone z;
integer table;
begin
end;
procedure clear_end_screen(z);
<**************************************************************************>
<* Clear all positions from cursor position (inc.) to end of screen *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
outchar(z,'us'+128);
end;
procedure clear_end_line(z);
<**************************************************************************>
<* Clear all positions from cursor position (inc.) to end of line *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
outchar(z,'rs'+128);
end;
procedure home(z);
<**************************************************************************>
<* Move cursor to the left position on first the line on screen (pos. 0,0)*>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
outchar(z,'gs'+128);
end;
procedure new_line(z);
<**************************************************************************>
<* Move cursor to the first position on the next line *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
outchar(z,'nl');
end;
procedure cursor_left(z);
<**************************************************************************>
<* Move the cursor one character to the left *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
outchar(z,'bs'+128);
end;
procedure cursor_right(z);
<**************************************************************************>
<* Move the cursor one character to the right *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
outchar(z,'can'+128);
end;
procedure cursor_down(z);
<**************************************************************************>
<* Move the cursor one line down *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
outchar(z,'nl'+128);
end;
procedure cursor_up(z);
<**************************************************************************>
<* Move the cursor one line up *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
outchar(z,'sub'+128);
end;
procedure bell(z);
<**************************************************************************>
<* Make a audio signal on the terminal *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
outchar(z,'bel'+128);
end;
procedure erase_screen(z);
<**************************************************************************>
<* Move the cursor to the home position and clear all chars. on the screen*>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
home(z);
clear_end_screen(z);
end;
procedure delete_line(z);
<**************************************************************************>
<* Delet the curent line and move succeeding lines up *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
end;
procedure insert_line(z);
<**************************************************************************>
<* Move current line and succeeding lines one line down *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
end;
procedure invers_start(z);
<**************************************************************************>
<* Start writing invers characters on the sceen *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
end;
procedure invers_stop(z);
<**************************************************************************>
<* Stop writing invers characters on the screen *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
end;
procedure highlight_start(z);
<**************************************************************************>
<* Start writing highligt characters on the sceen *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
end;
procedure highlight_stop(z);
<**************************************************************************>
<* Stop writing highlight characters on the screen *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
end;
procedure set_cursor(z,column,line);
<**************************************************************************>
<* Move the cursor to position : column,line *>
<* Position 0,0 is home. *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<* column (call, integer) : Cursor column value *>
<* line (call, integer) : Cursor line value *>
<**************************************************************************>
value column,line;
integer column,line;
zone z;
begin
column:=if column<32 then
column+224
else
if column<64 then
column+160
else
column+96;
outchar(z,'ack'+128);
outchar(z,column);
outchar(z,224+line);
end;
procedure init_terminal(z);
<**************************************************************************>
<* Initialese terminal *>
<* *>
<* z (call, zone) : Specifies the document used as terminal *>
<**************************************************************************>
zone z;
begin
end;
▶EOF◀