Volume 1 Issve 1
VilleIEMINIE
San Francisco/Bay Area Timex/Sinclair USERS
#1.00
Learning 280 A Assembly Language Programing
In order to program in assembly language we must first look at the " Registers ". Registers are pieces of memory located inside the Microprocessor. They are used to store, retrieve and manipulate numbers, characters, and addresses.
Fach type of microprocessor has its own individual set of registers. The names of the registers provided for the z-S0A are: A,B,C,D,E,F,H,L,SP,PC,IX,1Y,1,R
The registers A thru L plus I and R are eight bit registers. Computers talk to themselves in binary arithmetic, in f's and l'g. An eight bit register can hold eight f'a or eight 1's in any desired order. If all the bits in an 8-bit register are set to 1's i.¢., 11111111, then the largest number the register ean hold is 255 decimal, This is a very limited amount so the 8-bit registers can be paired. When paired, they are now 16-bit registers and cen hold a maxirmm of 65535 decimal or 1111111111111111 binary.
A brief description of the registers and their pairings follows: “AF" ~ A ia called the accumulator, It ia the primary source and destination for most arithmetic operations,
"y" ~ 1s the flage or status register. It 1a an extremly important one. Certain instructions will set or reset these flags ae appropriate, r js an 8-bit register with six flegs. The names and a brief descrip- Yeap OF the flage follows: ; ;
"a" sign takes on the value of bit 7 of the accumulator after
a mathmatical operation.
"z" sero if the reeult of an inatrustion is zero this flag is set sux carry or half carry=set if « carry was needed from bit 3 to bit 4
p/o = parity/overflow. A dual purpose flag. Firat it indicates the number of 1's ( aven or odd ) in the 8-bit accumulator after an operation is completed. Second the overflow is set if the sign of a number was changed. More details on this later.
“n" = subtract status set to ] is subtraction, ¢% otherwise.
"ce" = carry set if an operation resulted in «a number that was larger then the register operated upon could hold. This is not the same as overflow.
"RC" - Historicaly this register is called the byte counter. This register pair, more on pairs later, can be used to count iteration of a program ( similar to for-next in basic }:
"DE" - sometimes called the destination register. This is just another 16-bit paired register.
“HL" - The primary addresa pointer. This register is generally used to hold an address. When you want to do something to a specific address it is held in HL. For instance: if you want to load a
number into ean eddress you usually load HL with the address then load the contents of HL ( the address pointed to by the HL pair) with the number desired. Much more on this later.
"Sp" - called stack pointer. This register is used to make
a stack. Stacks are very important in programming. One use for
the stack is to preserve the values in registers by "pushing"
1 onto the stack then "popping" them after. Ohe important point ‘eer'remember about stacks is that first on the stack is the last
off. Failure to do this operation will definetly cause a crash.
"PC" - the program counter, Used by the computer to remember where the next inetruction to be executed is located. It cannot
be| manipulated directly by instructions but many of the jump
(goto) and eall (gosub) instructions manipulate it.
Machine Code Graphics: The T/S 1009 (and ZX81) Display File
If you want to program fast (or medium speed) games on the T/S1000,Sinclair BASIC is not ap- prop‘iate. Z80 machine code is currently the most convenient to use. However, with machine code (MC) you do not have the convenience of the PRINT or PLOT commands. To display charac- ters on the screen you have to POKE the appro- priate character code into the proper address of the Display-File (D-File). It is necessary to understand the layout and function of the D-File to be able to use it. The following discussion attempts to describe the D-File of a° 16K machine. 1K or 2K D-Files are arranged very differently.
The D-File of a T/S1000 contains the informa- tion for the current screen display that you are viewing when your computer is operating. It contains a strip of 793 Bytes in RAM. Each 8yte contains either a code for a character to be placed in a specific screen location or a 118 (76 in hex) that tells the machine to end a line. The D-File does not stay in one place in the RAM. However, you can always find it since the current address of the D-File is in a system variable that is stored in addresses 16396 and 16397 (400C and 400D in hex). The D-File start- ing address is always:
PEEK 16396 + 256*PEEK 16397.
Now let's examine the D-File.
the program in Listing 1: LISTING 4
Enter and RUN
iat] £
NINH Re Sab ths A Sd
FOR F=08 To 7 Y PRINT AF edi,” ";
ee0 NEXT F The program displays a blank screen while it
rs
copies the D-File into the A array. It then prints the D-File of the blank screen onto the screen (the screen will run out of space so use the CONT command to complete the program). As you will see the D-File begins with a 118.
There a then 32 0's which mean that the first Tine is all spaces (see the character set in the appendix of the T/S 1000 Manual). If the top row displayed a row of A's then there would have been 32-38's instead. If you don't believe me add these lines to the program:
30 PRINT "AAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAA" 130 CLS
(32 A's)
PRINT “RPRGR hh
"mx", "Iy" - are index registers. They are used similar to HL , as the usually hold addresses but require an ofset or displacement with them. For inatance if you have a table of data and you want the 12th item from it you could load IX with the address of your table plus 12.
"I" and "R" - esoteric registers. J is called the interrupt vector and is used to store the page address.of an interrupt response routine. R is called the refresh register and the most refreshing thing about this one is that it is not easential to programming in assembly language,
Binary numbers are extremly bard to program with. The program on the right contains an error can you see it?
00111010 00111010 01100000 01100000 00000000 00000000 01000111 01000111 00111010 01110010 OLLUVUUL 01100001
To correct this, moat assembly language is done in Hexadecimal
number system. Hexadecimal is directly transferable to binary. Here is the same program in hexadecimal.
3A 3A 60 60 00 00 47 MT 3A T2 61 61
To count in Hex (as it is called) we need to use letters as numbers The number 10 in hex is 16 in decimal . So we met fill the gap between 9 decimal and 1$ decimal. Here are the hex digits and their binary equivalents:
ry yy a 02 0010 03 0011 ob 0100 05 0101 06 0110 OT 0111 08 1000 09 1001 OA 1010 OB 1011 oc 1100 oD 1101 OF 1110 OF 1111
In the next artical we will used this infromation to enter a basic program that will help us understand and enter machine code.
F.J.M. 6/3/83
ZX 81
bs Sinclair |
T/S 1500 SPECTRUM
HARDWARE ¢ SOFTWARE _¢ BOOKS ALL MAJOR BRANDS
SEND 1.00 FOR OUR CATALOG AVAILABLE JULY 1ST
(REFUNDABLE FIRST ORDER
SUNSET ELECTRONICS
2254 TARAVAL ST., SAN FRANCISCO, CA )4116 Tel. (415) 665-8330
TORT. FROM i fo} After the 0's there is a 118 which tells the machine to end the line. There are then 23 more lines of 33 Bytes (32-0's and 1-118). If any of the O's were replaced with another character code that character would be printed on the screen. A ha dy representation of the D-File is shownwag? Figure 1. It shows each of the screen spaces plus the right hand column which will have all 118's. If you add the number in a specific box to the beginning address of the D-File you can access that screen space. For example, let's put an "inverse space" into space 410 with this program:
10 LET P = PEEK 16396 + 256*PEEK 16397 20 POKE P + 410, 128
Any character can be placed on the screen using
“this method. Now add this line and RUN:
30 POKE P + 727,23 You can see that the 23rd line is now available to us which we cannot access with PRINT and PLOT. The entire screen is available to us in MC pro- gramming. Now you might like to try placing different characters to different parts of the screen after defining P as in line 10.
This technique is handy for moving graphics even in BASIC. Figure 1 shows that adding 33 to an address of a space locates the space directly under it. This is important for up and down movement. Diagonal movement is simulated by adding or sbrracting 32 or 34 as in the program in Listing 2:
1 i oo) : z ‘ag 18 18 ii x 120 IF To 7e5 OR T<1 THEN LE = met-]) i3@ IF T:7eS GR Tel THEN GoTo lL ie 14e 128 isa
Changing the value of X in line 20 will cause changes in the movement.
While the examples in this article were in BASIC the principles are necessary for use in MC pro- gramming. My article in the May BAZUG 83 news- letter uses this knowledge for a simple MC moving graphic program. That article is re- printed in this issue.
Joel Brody
T/S 1000 T/S 2000
DALANAGHANAAMABAAAR ABA AY,
-
on BUMUNE ad
roa)
mr I Tt
TIMELINZ REVIEWS by David Kinkead
EUREKA! There it was amidst the volumes of cutsie game books and reworded user guides, a volume with the unpretentious name "MASTERING YOUR TIMEX/SIN-., CLAIR LOOC PERSONAL COMPUTER".
ne o
o what's new..." you ask. Tim Hartnell and Dilwyn Jones have done an exceptional job of taking the be- wildered newccmmer to TIMEX from the basics through some sophisticated programming. Zach of its 18 cha- pters is divided into subchapters anc carefull; demonstrate the techniques necessary to master the Timex/Sinclair.
The programs provided are very useful (not just asteroid blasting) and contain an explination of why they are listed as they are. It also provides some helpful information on Saving space in your programs.
The authors are from Britain. Tin Hartnell is the editor of zx Comput ing and feunder/coordinator for the iiational ZX Users! Club. Dilwyn Jones runs a
users group in North ilales and is a technician in
the Welsh broadcasting industry.
Bantam Books, Inc., 666 Fifth Ave., New York, NY 10193. March 1983 33.95.
Pvc
ie i oe
— ; wae
BUSINESS eeaeseereereernaee $9.95 Budgeting 39.95 $9.95 Stock Analyzer cacececcee $9.95 Critical Path Analyzer .. 12.95
Bookkeeping .scsccececce WH.95 GAMES
Leap Frog ...ceccceeccece Star Voyage ceocevescsecee 59,6
Pung2loids .ccccccccceses £9.95 Invaders cecseccecccccene $9.95
$9.95
$9.95 Packman eeseccoccccecence $9.95
UTILITY
Asserbler .ccccocceccssos $9.95 Disasserdler ceccceececee $9-99 COMPLE? weceecse vevecses $9.95 Graph cecccccccccccccecce $9.95
AND HANY MORE EXCITING PROGRAMS
CALL FOR FREE CATALOG
DISCOUNT SOFTWARE, INC.
320 East 59tn St. Hew York, N.Y. 10022 Tel: (212)486-0980
moyen TAs ea ee "
Try
ts a) 55 Ne ai} TT
ert af . ANE THT ripe
be ; PIP en Pe Pn ta
' Sen R RTT eae aT ee 1 T ST Tn ra TICE
nn ri
‘te
cs Wn ee ii
SjUeWeSTYAeApe Peeu OSTE sy,
eyfam nod dzey uane [T, ep.
ot » ad ue] ° co bs ct 7 oO a aj ry = s ian os 2Q a 3° oy ®
3 0 co] S a co o op i) fc) i] > Q > e
ce) re Qo ce) i” @Q ne] bs x a a ~ > S Q isa a ® Fy ce < ic) ta] aa >
° 0) bdo 3 ° ° =} ct iJ ® Q wo 28hag a bs p g
a | = =) pa e od = 0g 0 @ a ° ei z : 2 ey Ss - ce Q ao} ae] ai ie] ct e 77) ° ~ n e . e
idwy epew sey dnoas feg yyaoN
eyy Apesaty
ayeyy Butpueds soy HUTT YOTY pue
Bamoy yUeag ‘SpeexUTy eaeq ‘ueusepToH Appel ‘e810en yueyy ysnm osTe om
*AYL Teed ewoo0eq BepT Sty} eHeU OF BUT -aedxe ‘saemsue Ssuotysenb ‘svept
sepysed yey. esyTyzuedxe pue saouet ey} Saesn [TB OY BduTaq of yUeM OM *sdnoud agosn eoue AbY [Te Jo uopyzedto pue e[nsupueg *Aeg YyyAON euy Woz SUOT}OSS PUTZ [T[,noA ensst sTyy uy *sdnoid Jesn [TeOOT JO uoTZZetoosse ue
jo 600, . 8 UO SaToOTye pue smataces aztugooea pTnoys suepeed TTV
anof peeu op, qno 4nd 04 enuTYZUOS of seYey FE FeEYM
eztusooe1 OsTe plMoys sdepeed TTV qeum ysn€ *Anq nok ezojeq *mouy 0}
393 4,Uu0p nok yeYY OS yeEeYM eUY ST queyicoduy sewoseq YE sMous euemqyos
eaey tS yey eaeEMyJos IO ereMpsey pue asempaey jo qunowe ey. sy
styy ynd 0} Bupya0m LEpamzes eat zue smeTaet aod ysttqnd pue yoe Too 04
ZOUF[eEWT] esn 04 edoy oy -Tyaed ey} YeeS PUB SUIODTEM eR
“ysnd Joy espyuxoqQY edi0er yUBYY pur SATSSO
eTTe ye az6ezyeTSmeu OU eq pTNoM s1eYyy
qtozye apeyy ynoyyt.
Fone op ah bod te dy UEP eb teat del WE OA ER hil Usa res sual eae PuAy oe Te 4 yt i! ftir ta SY Cam be era Sa rca | racy Ub Pebtpean a Tera hata bet a Heap yay ape Weed \ tt Ht ty Itt aya {vt a rip yh ee at at fe. ff Pee pedqri riethe Hee Haran pee yeu Vy fey OF a ETAT Ape Ft | Pe Fh Ee TART oI boda | ! | Ara |e as pie le a fit ti ae ee Oe 0 th eae" Bh Bag feats im pil 4 | ti Se TE ee raqty It Ii hiatal tices (2y | | Posas | peyptoa Perertipear Bi y tha da tii yeddbeae fijigis. aS Rig a | Vier: (oma ie dome Ae ed a be See bap ve ,
1 1 fade eae ka a | UTE TAM OG me mos ddd Tote ta ie i an iat tha i vupPootaiae Tha i rain dd poe riba tigey tera | fe odeat addbe tae i ry tyra ity ima sa A a nt i proun " hati \ ry pra may mi tir. i rea tenn Tt a Ut lee 4 Potirahe giro reentry Cie ee Sek OR eR ae | aes | tie aM GA | marae rhea fa vprat pn ime my 4 MH at SERA Ticih wi ry Sid ay fel hai his aaenien r eis ba ies ee Le ee roy Ae ee Hi reds 1 I Bi Profi Pera OT ep i ae ee a pe aes TE op abel be nm ive Wiha Tt oa al me eR ec Owe phe beat 0 Ltt hate He Tea Pa mii i Cy bea Up eae debe aya aeTpeat oe rycen | It rm by ee Pa Nala dail eer a Pity ob bd ty af me TN para wy rane yyy 4 { raft) 4 a i a I) WT AN = See PP Eada
Naud hada a re $n
Sc (igen oe os
*yRMay Ikveq 032 SuyuUTseq
woly YTNser ued YeEYY Saesn uUeamyeq UOTYBOTUNUWODS pesBetOUT jo e [due “x8 4SAfTJ eyy STF seqQeTSmeu ATYQUOUI eae dnoag uesn eauy Avg oostoueasy uBg ONdy & WAOF 04 SzZIOJJe ano 4EUY
MOU STU]
ie ee ' ‘ i i had ! jth Piel pb i ny fi | "4; (fae ies bf i "4 i | jst ttle Pos ' it ts “itt neta : 7 nes Hl snnnhann tion lfada it i ie TTL | ee trad | "t aU kee Poh ity fa | i bat wd Wut ' Men by a i “4 {! Citys Se re ! i oof rma! Pde dead pi rife pratt a i ee | re : MN ry pep TH = Ht Se p poVbeth Hifiha a mM Lie eo be n TUT Tat ie a torte 2 back Vitti rm] pati eae ea ¥ ret Se Aare Be dss
“ia
ENE
resets AMUN LIRA ANAL AAROUE ton As PIO Oa NEA AR
* 19949 [sMaN *ZeUuT TOUT], OFUF paaToae HUPTOUTS Sey OS CS] XEWIL ey} CpUT peaToas sey x7 aApETOUuTS eyy sy yULTouts
eeS 0} Buypaensa s,qI Jesn Xewt], eptm eaue ABY Mau & VONDP
“Ola 04 41Oojyjea qupol e ut~seq om enssy
sTyuy YIM
Bay
*yOOpP Buy AQ @2uad3azua HiYON 64, 22; “vy ‘e189 eques MITIVES CNH
AATIg Alua
ay)
a a ee
oo of ‘ba rut
ti
4 Hed MUOANGdELEUDSHATAPREDEAAAEGPUEAP TEA Dt
aT
id ee |
Yquow Woke gu OY @2 cA: wes
‘Wd OG
uotjyejodioy ayoaa bBurjyaou
137 9449 “Hd yo
AvaS INI gn?
2st
HiT EY oy UL
" i
ASA_LOdOd
ADVALVA WA WoL
ondvd NYS @ SrsO! pss7sulayshc 4e3ndwo>y——~
rm m 0 m n Q 3 & > iS oi 0
Snags ri a De Ba in “RAITT 7
Pn eae TT rt
ch S ® ie | i) c-
@ a a nt) “% ® .> @ ~ i?) 3° 3 ® ct 3° % ct & 5 = e
[ned
quapLsaud »/
*SOUSLM }Saq
} [Neadad
fi cca
i i ea
fT iia
LFF 4 ‘tt ~ eee PTL AT
“dew
aes - SOTYTTTORJ *daog uesfhq oyy ye wd QO} pue 2 Ueemqeq (F°sSen], YY e4y A[paesseoeu you) yYUOU yowe Jo Aepsen],
qSET 84} UC PTEY eae SsuTyeeu amO
cs) < ~» - a o. pal] o e
i. e re a o < o a i) a a % e¥) = i) ~ 3 pas) @ & oO be | fe) tie] a sy 3 a
d 04 Moy UO YonaysUT
*Bupuueazoud apes eupyoru uo Jbvufuas puodses sno YUeseid [T[TM *ZeUzZ[ewt], JO uoyTyoes
uno JOJ YUFTOUTS eweu eyy UTeZer TTT
ut weazou *dnoup aesy $/1 key yynog eyy se
P°FIFUSPE eq Nou TT[TM dnows ano uoCTy -ezyuesio mau Sty JO YINsed & SY
TT" 9H
nof 9es pue uedo ere ssutzeeu ey]
ALIN wtp ZuTyeou yxeu ano yy
pue ‘W
bl.
1 a
I ry a4 | Tera ba FT braces
Ae
! E racaeeypen Ra yi
com fo Pe Ba Vaart
AAARAALEAAAAARAGARAANAARARAAARARAANTNAAASA ASS REANAAMAAREARANGAAAAAAAN AAARRRSERAARAAANAANNABOANA NINA ARRAARARARAAARAANNAAAAARANORS RANA AY
Bet crt e it ma es]
*Suy[pew pue
BHBY F,UOM YT uot {ONpora JO 4s0o ayy aeaod dTey oF
iyeg eTOUM &
sBupATJ Rue JjO et,om FEYY MOU BUFR edjs., paeu osTe ay
amok jo fy
op é ON
*
aia <->, Sacer aoe
a8 044
Pate seeanagges wast
PEL
Now available for TS1000/ZX81 with 16K RAM,
= £
Printer Plotter in high resolution graphics; cassette tape & manual..$35. Business file management program; cassette tape with manual..........$10. To be released in June 1983:
Fast Fourier Transform on EPROM. Two 2716s or one 2764......
Dual trace storage scope with high resolution printer graphics & FFT.$100.
About the programs.
FAST FOURIER TRANSFORM. (256 point, 8 bit precision , magnitude, phase, complex coefficients, ONE SECOND, Hamming window). This program is 4 Kilobytes of solid 280 machine code specially written to our specifications and high standards. It is used for spectrum analysis and other scientific applications. Here is an example of its use: If you set up a bank on RAM of 256 bytes which represents a waveform of voltage (magnitude) verses time, the FFT program will... grab the 256 bytes of data from the bank, perform a prescaling of the data called a Hamming Window (optional), do the FFT, set up a bank of the real and imaginary coefficients (source of mag and phase), set up a 128 byte bank which can describe a graph of voltage vs frequency. set up a 128 byte bank which can describe a qraph of phase shift vs frequency. The waveform has now been completely described in terms of the magnitude and phase i shifts of a set of sine waves. The entire operation takes less than one second on the Timex which uses a 3.25 megaHertz clock. The data delivered is a full 8 bits of precision. The calculations have been performed with 16 bit precision to avoid round offs. The program is available in EPROM at addresses 8192 to 12288 in the ‘transparent’ part of the Timex memory map. The RAM banks start at 29K and can work in the 16K RAM with or without moving 'ramtop'. The EPROMs are available in either two 2726's or one 2764. The 2716's can fit on the Hunter Board. The 2764 can fit on the UM64 from Byte Back. Documentation will be furnished with the FFT. A complete manual including use, theory and applications of the FFT is in progress and can be delivered at a future date. We also plan to have the FFT available on disk for computers that run CPM.
DUAL TRACE STORAGE SCOPE. This is a report on the progress of our ''Scope" product. It uses the high resolution Printer Plotter by John Kane. It is designed to work with the Computer Continuum Analog Interface Board, TS/2X printer, 16K or more of RAM, and a ZX/TS computer. Upon RUNning the program the Scope automatically does a series of data acquisitions and displays the trace on the video monitor or TV. The user enters single stroke commands as outlined in the table below.
— —=ANAANANNI AUTOM ORCRNeLaeeS:
command key numerical entry function performed F -003 to 155 sampling Frequency in kiloHertz. Nd 0 to full scale Trigger voltage setting. c lor 2 Channel select. S do a scope Sweep (data acquisition & display). R Repeat sweeps every 3 seconds. P Printer plot with high resolution graphics. N Enter a label or name to be placed on the printer plot and do the printer plot. Vv positive real number set scale of Voltage full scale.
Each sweep takes 1.5 seconds to produce the video display. In single channel mode the sampling frequency range is 3 Hz to 155 kiloHertz. In dual channel mode the sampling frequency range is 3 Hz to 60 kiloHertz. Analog data is retrieved through 1/0 channels 0 and 1.
In progress is a cursor and numerical readout routine and spectrum analysis routines using the FFT. ’ High resolution printer display:
WAVE
= NETLORF SE
HEU 2 F
COPY to printer of TV screen:
On this page Eric Reiter, wizzard, brings us up to date on his latest projects.
Si eemmchenegeeeesenanmenna pated Seen “our own local TS computer aa (omputerq ontinuum | 301-16 th Ave A
Son Francisco, CA. 94118 (415)752 62"
PRINTER PLOTTER. This program can be used
the 2X or Timex printer. ft Is written In machIne code and BASIC. It Is well documented and modular. The program is arranged in 4 parts. Part 1 can be used to clear the plot image In memory. Part 2 can draw a 10 X 10 grid (graticule) in memory. Part 3 is used to plot a point at position X,Y. Part 4 Is used to generate or acquire data to be plotted. Data may be fed to the printer- plotter with either BASIC or machine code. A subroutine is included which fs used to acquire data through an 1/0 port address. The time interval between successive 1/0 data transfers ts a variable. After each time interval the X value will be Incremented to the right one pixel. The number of dots plotted per time Interval fs a variable, thus plots with steep grades can be filled in for easier visual analysis. The number of readings per dot [s a variable and Is used to average the data. These features are especially useful when the Plotter program Is used with our Analog Interface Board. This program has been used with a heart monitor and the Analog Board to produce the display beJew.
3 ¥ 3 7 , ’ Pagee , is me : = “2 ‘a piven mg
ently v : v ‘ ‘ ‘ : ‘ Si TS Ran eet Sn 5, pe ee
pment eae none ptrrenpet v ‘ “>
This program was written by J. V. Kane and Co, 109 Ardmore Av, Ardmore PA 19003. J. V. Kane and Co will be most pleased
to answer any Inquires you may have about this program.
2A Simple Moving Graphic _in Machine Code
When you cet your first computer and learn a few BASIC commands one of the first things you do is | make something move
A new T/S 1000 user may produce a program like this:
It s quite exciting to see the moving "inverse space” (IS) at first, but after a while you re- alize how slow ft moves and that Sinclair BASIC has very limited facilities for speedine ft up. The following 780 machine code orogram works the same way as the &° ve BASIC program does: How- ever it is executed 20 fast that a DELAY sub- routine had to be addec so your eye and display screen can deal with it. Its great sveed also enables us to add 8 speed control facility in an accompanying BASIC program.
Notes: A) The first 4 Vines locates the Display File and adds 798 to the address. This will locate the first space in the Ath line. (It is ir portant to understand the layout of the Dis- play file for doing "! C. oraphics.)
B) BR fs the counter for the (ll? instruction (see F)
C) RO is the hexadecimal character code for th IS. This line loads it into its prover place in the Display File.
D) This instruction saves the counter by put- ting it on the stack so it car be retrieved Vater with the POP instruction. We need the BC register in the DELAY subroutine.
E) The IS will move too fast unless we put in the DELAY subroutine. CALL is the M.C equr- valent of GOSUB. 2 CALLS are included to give greater control of speed.
F) A “space” 4s substituted for the IS.
G) Return to LOOP and decrement B if B>0.
H) NOP is “no operation”. It is an empty Toor that cycles the number of times as the number
that is loaded in RB. We can regulate the speed of the moving 1% by POFLing in a dif- ferent value for B
Pea neaecseseenesensesereanecaceseweseuerennnentes
15HOYE 45 34 Bytes long senbler program
If yo. don't use an as- or have @ favorite machine code loading
type in the following proqram
After you have entered the machine code type in
iesa>
10 RAND USR 16514
a0) 2HFig tS 30 FE # 4 ag te
and delete lines 20, 30 and 40. You should see the IS move steadily across the screen if you have entered the prooram proverly. The speed of the IS is faster thar the BASIC program, but it is still rather slow. However, as mentioned in note B we can regulate the speed by changing the value in register B in the DELAY subroutine.
The address of this number is 16543. The speed can be changed by POKEing a number between 0 and 255 into this address (0 is the fastest). The following program will help you do this (do not change your current lines 1 and 10):
Now type in the following numbers starting with 42 (16514 is the address of the first Byte), This 1s the decimal machine code listing:
Those who prefer to work in hexidecimal can in- stead use the following listing:
= TE E* ee
i
Ce QFE @é FE e2F eo eso ie Ff O32 ce
The 280 memonic listing and explanatory notes are as follows (all numbers are hexadecimal ex- cept those preceded by a “+"):
pretrrrocecccretrorciettitis]
RUN this program and it will ask you if you want to INPUT a new "speed factor”. After you de this
sTacr o the program will run each time you press N/L.
fee Pressing "C" instead of N/L will let you change AL the "speed factor” again. You will find that you ae bb e will not even be able to see the moving 1S at low
GOCE. (EE . values of the “speed factor”
cee aa A further excercise would be to put the moving
cay : 1S on a different line and to try to make the IS
Po move in different directions.
ue NOTE ©
ue
In
Cutty,
ee
Vin
noge
my
an re !
‘ 7 4a ot
ne Oe Se nN 4
‘20,21/22 t i |
t ' ' : ‘ | 3435/36, 37/35 139,40 #1 hr H |
las a4 tee
43.44 95 40 497 $8 44) 50'51 52 s3\eaiss ist 57 S¥\S9\Co'or ¢2' 63! PRE TaN tGc an at Bone a SO Se COD ES eeene eee ey pel ape sees
2siac'ar, '
A TYSTERY PROCRAT!
The following, "HYSTHEY PROGRAT is by a iol) Solt and was first published in the February 1982 issue of a British mapazine called "YOUR COCPUTER. Pore is the program with a slight variation:
1 PRINT "HERE IS A 10 YEAR BINARY COUNTER" 2 LET ASPERF 163964256*PEEF 16397432
3 LET BePELY A=157
4 PORE A, 157-2
5 iT AzA-1
6 COTO 245
The mystery is to discover wat it does and how it works. Type it in your computer and FUR it before reading, further.
Now that. you’re reading, further, ILL explain the "mystery to me. The first Line just reserves 32 spaces (for 1% or 2K computers). Line two sets A to the value on the left of the first Line of the display file. Line 3 looks like a mistake!! bow- ever the program works. Are you setting A to 157 and PEFFing, at ROM address 157?) ALL URCNG! The next line POKEs A so A can’t be 157. After sone more confusion 1 found Line 3 reads as follows: LET Bb = either a 1 if the number at address A is 157 (true) or LET B= a 0 if the nunber is other than 157 (false). The first equal sign tells the computer wiat_b is (assignnent) and the second equal sign tells the computer to test for true or false (boolean). So 5 is either 1 or 0.
Line 4 pokes an inverse 1 if B is 0 or an inverse OTE Pois:l.
Line 5 sets the address one place to the left.
Line 6 loops back to Line 2 if. PEE A was an inverse 0 or to line 3 if an inverse 1.
I hope all this is now clear.
The next mystery is for you to solve.
How do you save this propre?
Pob Orrfelt
25-24 30:37 32:33! edt De Ret i a 64 os! bb :
£7 O64 | To 4,11 peg ta vei pes min | 79) FO 8t 92 i [456 87) 39; 89 90 197 PRES IRAE 2/49 4699, 190,191 sor 1031/04 ya bar lca ea i Wee uh |r Me NT HEING ae sna \133 rag Ag saat beak df 139 3073111321 193) 194) 38 136 037 nv i139| fo /4) \ see 193) 48 145 Mee 197) 14 149150) 1511521531 54 iss Ist '1s7\ ss S410: Moh we 143! 44 165) “1b tet NOU) 109 1% mln | raster las Lawl in| re 9 nei ie sesi sedi ssl ove 187 | 189 189) Ao | 197 ri /99' 1! Msi sme, 1971 toy HICEFALUT IN’ ba iene 401 \J0x aad a ie an 207/204 La ae | a jan (a3 alas ae len | uyiay abal acide ‘easlaaslans zat] sey aeylaey| 26,231 COMPUTIN’ ‘aga se as} aprjan 20 jae as? iato ati age cats es at aha atv at aay ase asta | Last\asr as mat at8j 257 sue 241 a0 aes cut with abs 206 coi eal ue am an |areian| ant! aot ian an an a ‘avo 281 srsloysiat ars see|ar arama at i Mig cag ae as anly ; at an 400 361 902 [303 Sof |B0§ se | 347 404 SOT. 0 isu ya lara alas if isn | sve 49 326 | 32)! guna sat s.5 | 320/327 say 329,380! Fob Orrfelt 391 $92 | 393) te 83391 x! 97! ate |sya i“ \wt bar ‘Ww? srl alan [ars sera on 55s 00300 j xt peepee |310\9 sn is al 75 sm 917 eu ' ssolaa (3H an5 389 a5 alas prt 30 vate eee on your 317 S41 997 fo} for fo | ea |4ch for tov | for io | fot 40 Hit [4a #4 der Me er | Ae iy fhe, far hs fay tht fac] tae) #7 tar 409 TS L000 Conputer Sisal ae he itt 495 Aye 437 ret Mo ft aa tal sail #4 $50 | 4n1| 4s) gall ted gd ist | de7idsri 44 ss Zi fgg weed hee for desi ten tanita iE al at ag ead a bag trbpad tee ee tay taffeta #12 igual baal Intro to advanced ideas. Me j iar £20 | | $08 | 309) yop 505 | oe SOT |e" '509 $0 Su $m $09 | 6s ier jst | £77) 204 208 Ipne| ee se re Jed Cts Dice to hex, and more. fed ee j3 /s9 S34 [977 al ad fa eels ail dtd lata esi |gra 553 SHH 935 ers Paes ; 120 pages, 30 prop rams eels sth | 5Ue | 6uc |567 | Se¥ ger 5te zu dh i sie dal hs aie cs a ts fe sts sists 5bb 537 mead Es i ie ies For your copy send istsisee 517 51 [679 |6eo bor jbo 40> [bat [60 tog te7 coy cot ier out jee PD) 6 ers love or |r ioe be saps eases eas! goe\ oe $11.60 inc s&h to ay i | 690) A aie ak ed we Vais ald hr ibs jegeioes, ptoyetr che | Conese aries: ors rt leeciess te2 Orn eT ota Bah Cee role
Pa 66d [664 poe He Sanieoe 644 ene eel bee CP eet are bre rete drt ee fat je62 ces cat ort 636\6e7 ew Gry Cpocar | 672, “s 3436 Kay “Road F
esroneoarcrreey 200! 781 ig a Pet ines 704 |707 i708 708 Tey74 qe rig are mia ne 79 fae] tee | Ten Fee, tet 7007172 Redwood City, Ca 94063
Kk ba Read ta pete 5|7 197 109 999 mo 1h ma | Mae |S 1h ae T9150 741) Araiey 7a9i75s 7H ed sa Mic ed Ces cae ie Tver Pee 223, 706,778 9761777 mina mm 77H 78,7 eid ees
a al i i, 4 ey: i a ee i | ok POR Tt ager a Yoh) eee eye Pa ee y : - F 4 1 THIS CoLvAY i
COUT AINE ALE’ titers
S575 52: Poa rae = z 25 SET-UP ROUTINE = 410 = = Bg = perce THESE COMHANDS-NC LINE No. 20 5m am BE = 38 440 45@ ; 5 i4 Ma 460 TELEPHONE LIST 470 LOAD “FONE” 43a GOT 490 CLS ; } FEATURES : sake Ae ae alae areal CORLL eye 6. at VRIGST L922 GEGALO F £10 PRINT "NAME 7" Search Routine: alpha-numeric, finds full name or first S2O INPUT Netx, Te letter of names, or finds a phone number by the last 4 digits. Egtid: | FRA PRINT " (i.e. that forgotten long distance call on your phone bill) HSIA, Se 540 INPUT A sorting sub-routine saves search time by moving mcre fre- E=O Seq RINT quently searched items to the top of the list. A floatina end- ES= 4 eek PRIN point saves time by not searching the unusec section of the list. _ aha CME NO. 7! gO CLS) 5 on : 56a INPUT MENU DRIVEN COMANDS:LIST,.. (prints out all list items) 28 poet : : ie ; 7a SPRINT - (allows additions to list) Se NT THEUT (removes from list) PRINT (finds name/nunber) SIZE
RECALL. (finds number/name) FILE...(files ammended list)
GOTO 6
FOR NAME
NUMBER © CE ey ae ah SET-UP ROUTINE: Takes only a minute, ) time. LE ON TAPE": PRINT "DELETE NAME 7 Allows you to name the list. a5 PRINT INPUT Z$ Allows you to set the size of list. LET &®e=l1 Clears a used list.
IF NBixX, TO LEN ZHI=E$ THEN
WME So ON WP SI ISUOGVSEEGASSESEG50c0nm
SMUT AAO HHT HOM AAT,
THE SET-UP COMMANDS ARE: 1. ENTER SOTO pee GoTo asa -space- ENTER ae LF: Ms THEN GOTO 80 RUN 2 ENTER 120 LET xk=*%41 LET BS="name of list" ENTER 348 GoTaQ 66a LET A=size of list ENTER cet CLS 95 ENTER 21¢ SINT Net) GOTO 30 ENTER LAE eee Net Ss a RS a -, - ag THESE COMMANDS ARE ENTERED WITHOUT LINE NUMBER! @ ise hee 3 eh a, DELETE [TRAE 155% Use GOTO 1 ENTER, after a ~break- or an error code, e E % to return to the Menu. On occasion you might get an error 17e@ code 5/linef#, this happens when your search returns more 130 lines than the screen can hold, C ENTER will allow you to ige
continue. You can input 0,1, or up to 18 letters to search i.e. SMITH will return all Smith names, including Smithe. If you're not sure of the spelling, Search SM and get Smith Smithe, and Smythe John.
’
t PRINT We ly
TH
NOTES: This program was written for 16K, TIMEX 1000, and will hold 300+ names/numbers in 16K. If you have 32K memory you can LET A=700 and the list can hold 700 names, with a corresponding increase in LOAD time. I recommend a "size of list” of 100 as a
LET NsiB} sé
6109 0 6 GL NS NN NN Ng NON WMe SSO -IMM ee SSCECoocc tC seceCceqeEeE7 3s9a6
149 5a convenient size as this fits nicely on a C-5 tape. 6 O ae 1 BS 1s any name you wish to head the list, it can be 7@ GOoTa Baa up to 14 characters long. Line 95 is a list of set BQ PRINT "LAST ITEM" up commands in case you lose this sheet. 1. ENTFE (20 PALISE ieae after you LOAD the first time, prints out information o eoTo sa stored in array; it is removed by GOTO 30 when you 8 aa Be he 4 SEE uP @Q PRINT "NAME 7" X ¥ 390 A3Q INPUT 2 420 40 LET F=a S@ LET) est —— eo eee Oe Oe eee
10Q@0Q LET y=% 110 LET Tengen iBe@ PRINT T
183@ LET
e+]
1040 IF x.=E THEN GoTo 1ese@ PRINT 1@6@ IF F=@ THEN PRINT "cots ze
vee NOT FOUND” 1270 IF F=l THEN PRINT “NO MORE
eee 1Q@82@ PRINT “ON LIST” 1090 IF F:; ‘2 THEN GOTO 114ae
11@@ FOR x TO & STEF -1 1110 LET NSixi sNECK-41) 112e@ NEXT x
113@ LET N$i(ii=T$s
1140 GOTC 30
115@ CLs
116Q PRINT "LAST 4 CIGITS OF NuK BER 7"
117@ INPUT 2%
1182 LET F=a
1190 LET x=1
128e@ CLS dei@ PRINT “SEARCHING... °:3 27% deeQ IF N$ix®,20 TO 3B) Z$ THEN GOTQ 1258 1230 LET Fei 1240 PRINT Ngix) 125@ LET w=7%41 1c6@ IF %+=B THEN GOTO ize2e aaa” dev@ IF F=@ THEN FRINT 2%." NOT LISTED”
c2@ GOTO 72
CLS
PRINT AT 18,18. "START TAPE" le. "KEY "ENTER
INPUT Z$
SAVE “FONE”
GoTc 1