18.10.2013 Views

V4N4 - Complang

V4N4 - Complang

V4N4 - Complang

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

I ,CTT.lC<br />

-id t LIX" v<br />

I~dlfiC; 3iA Ii~trrfacr for use with cassette interface. Each block<br />

L U reziorags ~ to a full screen) but 51nce hlock 0 is used to indicate terminal<br />

d~eration, ;luck 1 is for screen 0. ( that is, hlocK# = screen# t 1 )<br />

rLt 5 - n ; F'l-ces the blocK nuuiher currently occupyln9 the buffer onto the<br />

stacl~, If the mst 5lsnlficant hit is set it means hlock has been updated. )<br />

l'LCCI,N: DOCOL TIRST AT SEMIS<br />

UFDATC ( Modified to use BLh# )<br />

UrKIAT: nOCOL ELOCKN LIT 8OOOH ORR FIRST STORE SEMIS<br />

Fur I -- n ; A constat uhich leaves address of first data byte of buffer on<br />

the ;tccK.)<br />

BUT: DOCON Rum<br />

HI ( - - n ; User variable containins address of end of screen area.)<br />

IIIGII: DOUSC 44H<br />

R/W ( ad, n f --- ; adr refers to buffer, n is hlocK numberr f is<br />

flbz,O=write,l=read, Dislc rriailtive reuritten for simulation of disk by<br />

fierrtwii. See fis-FORTH installation manual. Error $6 is "SCREEN RANGE ERROR". )<br />

RSLW: rrOCOL TOR ONE SUBB BHUF STAR DUP HIGH AT GREAT LIT 6 QERR FROHR ZBRAN 4<br />

SWAP 1:BUF CtlOVE SEMIS<br />

CUTTER ( n --- adr ; A ssisns buffer to hlock n. If contents of bufer are<br />

aarlted a5 urdatedr it is written to niemory. Address left on 5tacK IS first<br />

data brte of huffer,)<br />

BUTFE: DOCOL IiLOCKN ZLESS ZURAN IOH BUF RLOCKN LIT 7FFH ANDD ZERO RSLW FIRST<br />

STORE CUF ZEMIS<br />

BLrJCI< ( --- aijr ; n is a hlock numberr adr is the address of the first data<br />

hste a-f the buffer. If the block is not in the huffer already, it is moved<br />

there, If the block in the huffer is different and is updated it is first<br />

moved to screen menlorY. 1<br />

IILOCK: DOCOL DUF' RLOCKN SUBB DUF' FLUS ZRRAN 10H DUP BUFFE SWAP ONE BSLW BRAN 4<br />

DROY HUF SEMIS<br />

FLUSH < Write huffer to memorv if updated. j<br />

FLUSH: DOCCL ZERO FUFFE KIROP SEMIS<br />

LCCD ( n --- ; R esin interpretation of screen n.)<br />

LOAD: DOCOL ELK AT TOR INN AT TOR ZERO INN STORE ONEF' RLK STOKE INTER FROHR<br />

INN STORE FEOMR HLK STORE SEMIS<br />

< Labels not explained ahove w i l l be found in the Assenihlr<br />

added and the link field of the first<br />

word added to the name field address<br />

of .CPU (DA58) and link the added<br />

words appropriately.<br />

The revised listing is now ready for<br />

burning into EPROMs. Without an<br />

assembler, entering the program into<br />

memory is a tedious task but effort<br />

spent in checking at this stage will pay<br />

off later in debugging time. It can take<br />

quite a while to find that you have<br />

reversed the digits in a byte some-<br />

where or have switched the bytes in a<br />

label. Check your I0 routines in the<br />

first page of ROM carefully, be sure<br />

they work as intended and be sure<br />

your code for COLD is written and<br />

entered correctly.<br />

If you read "8080 FIG-FORTH" on<br />

your screen on a jump from START<br />

(COOOH), you are indeed fortunate.<br />

Your debugging procedure will de-<br />

FORTH Dimensions<br />

pend on your front panel and utilities.<br />

If you can step your program to JMP<br />

NEXT in CLD (DOCA) and change the<br />

value of BREAKPOINT (at 857E) through<br />

the front panel you can run the pro-<br />

gram under control until it crashes and<br />

thereby locate the problem.<br />

After I removed the bug from the<br />

system, I was ready to start writing<br />

programs in FORTH. I found Starting<br />

FORTH by Leo Brodie (3) very helpful.<br />

As I began to learn, I soon realized that<br />

I required an Editor. Fortunately, I<br />

was in contact with John Cassady (who<br />

implemented 8080 fig-FORTH) who<br />

supplied me with a compact Editor<br />

ideal for ROMing. I entered the<br />

screens in RAM using my "typewri-<br />

ter" utility and LOADed them. For a<br />

while I saved the screens on tape for<br />

use while I was placing the Editor in<br />

ROM. After loading the Editor, I<br />

19<br />

Source Listing. )<br />

printed out the RAM dictionary, iden-<br />

tified the words by their ASCII<br />

characters and the DOCOL and SEMIS<br />

addresses and transposed the code to<br />

ROM, with the link field changes<br />

described above.<br />

Implementing my fig-FORTH sys-<br />

tem has been a long laborious process<br />

but I have acquired a good understan-<br />

ding of the language as I have pro-<br />

gressed and I am looking forward to<br />

increasing my programming skills.<br />

References:<br />

1. Fig-FORTH for 8080 Assembly Source<br />

Listing. Release 1.1 September 1979. FORTH<br />

Interest Group.<br />

2. Fig-FORTH Installation Manual. Release 1<br />

by W. F. Ragsdale. November 1980. FORTH<br />

Interest Group.<br />

3. Starting FORTH by Leo Brodie. Prentice-<br />

Hall, Inc.<br />

Volume IV, No. 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!