Playing With Electricity

Author(s): Harvey Taylor
Publication: ZX-Appeal
Date: December 1985
Pages: 7, 12-13

Well I finally got my printer . You will just have to put up with my messing around with different typestyles. Between Quill and the LX80, there are a lot of different combinations to try.

In the last column I managed to get to Paul before the deadline (sigh), I posted some results ofthe Sieve of Eratosthenes in Superbasic and 68008 Assembler. Now that I have my printer, I can get the code on paper & so here it is. Any of you who may be experienced 68K hackers may see ways to optimize the code. The ‘GET FLP2_standard_hdr3’ line at the beginning is an instruction to the assembler to get the file which contains all the QDOS system calls & values. ( Well most anyway, I’m adding them as I use them & there are 150+ QDOS calls documented.)

By the way, that reminds me. Anybody who is going to get into some serious programming will find ADRIAN DICKENS “QL ADVANCED USERS QUIDE” invaluable . There is also available from Boston Sinclair, The QL Technical Guide , (US$20.00 + shipping) which has some additional information.

Also by the way, If this article should happen to fall into the hands of any other QL owner, drop me a line. I’m trying to maintain contact with as many QL’ers as possible.

Back to the listing, as you see, most of the nonessential code consists of system calls (via QDOS,QDOS_N,VECTOR,&VECTOR N). This makes it easy to do the simple sorts of housekeeping things that always need to be taken care of ……BUT, IT MEANS YOU GOTTA DO IT THEIR WAY. WHICH IS OKAY IF ‘THEY’ HAPPEN TO BE GOING YOUR WAY, (EXCEPT HOW OFTEN DOES THAT HAPPEN?)

THERE is a direct correlation between the assembler listings and the basic code of last time which will give you an idea what the code is about, label by label. GET IN TOUCH WITH ME IF YOU HAVE QUESTIONS.

RD_TIME     QDOS_N   MT_RCLCK,1
LEA BUF_TOP(PC),A1
SUBA.L A6,A6 * zero A6 for CN_DATE
VECT_N CN_DATE,A2
MOVE.W (A1)+,D2
MOVEQ #-1,D3
LEA SCR_CHAN(PC),A0
MOVE.L (A0),A0
QDOS IO_SSTRG,3
BNE ERROR
NEWLINE MOVEQ #-1,D3
QDOS SD_NL,3
RTS
SND_MSG2 LEA MSG2(PC),A1
SENDIT LEA SCR_CHAN(PC),A0 * RETRIEVE CHANNEL #
MOVE.L (A0),A0
VECTOR UT_MTEXT,A2
RTS
*
MSG2 DC.W M2END-M2
M2 DC.B ' COUNT= '
M2END
*
MSG1 DC.W M1END-M1
M1 DC.B 'SIEVE OF ERATOSTHENES',10
M1END

SCR_CHAN DS.L 1
SCR_PAR DC.W $0401
DC.W $0004
DC.W 384
DC.W 128
DC.W 64
DC.W 32

BUFFER DS.L 30
BUF_TOP
ADDR DC.W 08
CON_BUFR DS.L 2
STACK DS.L 4
STK_TOP
END

Also printed in ZX-Appeal January 1986.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.