H4th - Edit screens

Programming in Forth
Post Reply
Admin
Site Admin
Posts: 15
Joined: Tue Apr 02, 2019 5:29 pm

H4th - Edit screens

Post by Admin » Tue Apr 16, 2019 6:35 pm

These words allow the edit screen to be saved and recalled. On a 16K system, I have created 10 screens - numbered 0 to 9.

The number of screens are set using the formula screens * 256 -2. So 10 * 512 -2 = 5118
The other two bytes is is allocated when variable SCR is defined.

0 VARIABLE SCR 5118 ALLOT
: EDIT ( MEMORY TO EDITOR )
512 * SCR + FBUF COPY ;
: SAVE ( EDITOR TO MEMORY )
512 * SCR + FBUF SWAP COPY ;

Post Reply