SPACE Newsletter

November 1985

View the original PDF

November 1985

/

t--~ Ct 1-•••-1 E t·-·1 B E F.: Next meeting:

We will

Friday, November 8,

hold elections at

7:30 PM

this meeting.

Be sure to notice the new meeting Map on bacK cover. place. December meeting:

Bob Floyd Bruce Haug . Fr·ank Haug ,Jim Schu-1 :z

Friday,

December

13

Pr·esident 487-2627 Editor Jon Nelson 774-6226 Vice-Pres Treasurer Max Feuer. 774-6226 Disk Lib. Cass Lib. Bruce Haug Paper/Ed. Lib. 537-5442 Secretar; Steve Pauley SPACE/TAIG Bulletin Board . . . 473-2897

Pa1Jl Publ i ·:-hed b::,' the :::;t. Enthusiasts Computer Atari independent an (SPACE), organization with no business Atar·i .1ith -:1.-f-fili.:1.tion is Permission Incorporated . similar any to granted organization with which SPACE to newsletters exchanges th i ·=· in r·epr· int m-::1. ter· i .:11 We do, however, newsletter. the to ask that credit be authors and to SPACE. those Opinions expressed are o-f the article authors and do the not necessari ]y reflect club SPACE, o-f views or Atari officers, members, Inc. 1_.o•

484-9027 483-3895 774-6226 560-2917

IN THIS ISSUE: PART 11

(final) OF CHRIS DOS TUTORIAL

COPLAND ✓ s

PART V OF CHRIS CRAWFORD ✓ s ASSEMBLY LANGUAGE COURSE NEWS FROM THE V.P. AND PRES. PLUS ALL THE REGULAR MONTHLY COLUMNS.

\ BYTES FRltl THE PRES, by Bob Floyd Who was that 11asked nan? - I wasn't sure whether the last meeting was "Shootout at the OK corral' or a Jack Tramiel testimonial, I think the last meeting turned out rather poorly, We didn't get to see the prooiised demos from ATARI rep Chari ie Devine and he didn-'t answer any of our pre-selected questions. It was obvious that Char] ie did not intend to demo anything, including the Casio keyboard he prmised only 2 days before the meeting to bring (we lucked out and had one there anyway), Don't figure on our inviting him back. Also, the ambushers of the rep could have waited until after the meeting to spring their trap. (1-'m not sure this would have worked anyway since Chari ie beat a hasty retreat). I'm glad that meeting is over. Elections this month - We will hatie elections this meeting, Look for the separate article by the nominating connittee on who is running for what office. New meeting rom - Be sure to come to our new meeting rom this month. We are nearby the old location, only 3 blocks away. The meetings are in the Falcon Heights Connunity Center at 2077 West Larpenteur (near Gortner). The police and fire station are in the same building and a Hewlett Packardnffic~ is next doo~. See the map elsewhere in -the newsletter. Hopefully this a meeting roan we can stick with for a while. Heeting agenda - We will try not to spend too much time talking this month and spend more time on demos and swap meet, We won't spend much time on ST stuff since sine decision regarding mini-groups or new group for ST is imminent. (Bruce Haug and myself are having discussions with others concerned and will figure something out soon. The club will remain loyal to the 400/800/XL/XE series). !Map Heet - There will be a swap meet this month after the meeting, This is for buying and selling of used software and hardl!lare. If you are selling software, you must have the original documentation and software - no pirating!

NICELIST - Remember the program 1ister we offered to the club a few months ago? Apparantly ATARI I ikes NICELIST enough that they nCM use it for program I istings in the "ATARI Explorer". They called me up to thank me for the program and have prmised to mention SPACE in the near future. Bye-Bye - This is my last 'Bytes•, so I just wanted you all to knCM that I've enjoyed being "the pres• and plan to stay active in the club. I think that the club has done well in the last 16 months and I'm sure this trend will continue with the new officers we will be electing. Thanks to all who helped along the way'

ST's WAAT TO DO BRUCE AAUG V.P. All we hear is ST this, and ST that! Well it's about time all the ST CMners get together and form a SPACE 520ST SIG, that is a part of SPACE. The SPACE officers are willing to help get a group started, but not run it. The group can decide for itself what they want to do, such as: meet before, or during the SPACE meeting, like the BEGI~ERS GROUP, or on another night at sane other place, The SPACE 520ST SIG would have input into the main SPACE meeting, have access to the newsletter to print ST NEWS, and have money to start a ST disk of the month. I'an sure all the details can be worked out with the newly elected officers of SPACE. By doing the ST as a Special Interest Group (SIG) the members of SPACE can have the best of two cmputing worlds, The EIGHT Bit, and THE SIXTEEN bit, With both included in one membership fee, and one newsletter, The rest of us can get back to the world of the EIGHT BIT machine (the older and newer Atari's) and enjoy the meeting without it being devoted to ST NEWS. This does not mean we will not hear about the ST, but the meeting will be more old Atari than the new ST. Rumor has it that User Friendly has already started a 520 ST group, cme to the meeting and find out whats going on. I hope there will be enough interested ST owners at the meeting to get something started, in +act they may have ~. lot of things to bring to the SWAPHEET, so everyone should c011e. SEE YOU FRIDAY. October Meeting Hinutes by Joanne Floyd The last SPACE meeting was held Friday, October 11, with 86 people in attendance. In discussing the latest news fron ATARI, Bob Floyd cited an Infoworld article which reported that the GEM operating system in the 520ST will be altered to avoid lawsuits with Apple. In the president's report, Bob discussed reasons for the move to the new meeting roon at Falcon Heights C011111unity Center. In the vice president's report, Bruce Haug reminded members that •c• language disks are available fran the club for i4; he also recommended Going Frm Basic to C and The C Progranning Guide as good resources to buy to learn the language. (Both books are available fran the paper library.) Max Feuer, the treasurer, reported that the club has a bank balance of $960. Dick Johnson, the president of TAIG, reported that a 130XE has been purchased for the BBS, and that the SYSOP is trying to structure the board to allCM higher access to TAIG In new business, the nminatin~ and SPACE members. connittee announced n011inations for the offices of president, secretary, and treasurer and Jim Schulz was nminated frcn the floor for the office of vice president. Bob Floyd mentioned that a newsletter editor would be needed

// 3 ; ; replace Jon Nelson, (He ,ot,d that Sf)ecial th ..ks should -

be given to Jon for the great job he's done with the newsletter.)

.,.J

At the end of the meeting, Charlie Devine, the local ATARI rep, spoke to the group. His talk was long on unconvincing accolades to Jack Tramiel and short on useful did mention He demonstrations of new products. (unofficially) that there will be no new 8-bit line from ATARI since they consider the fu-: .• ~~ of ccnputers to be in the 32-bit line. He predicted that the operating system upgrade for the the 520ST would be available within 60 days and that IBM ccnpatabil ity would be available for under $300 within 4 or 5 months. At the end of his talk, Charlie asked for ccnplaints about ATARI but was not very helpful or informative in dealing with the complaints.

-

NOTES FR!tl THE EDITOR by Jonathan Nelson I would like to thank all of you, especially the other officers, for all the support you have provided in the last sixteen months. You have provided each other with better, more interesting news. I hope you keep on supporting the editors-to-cme as much as you did me; it will make his job easier and your newsletter more exciting. So long for now. The Ed

Nltllt-¥1TI~S COMMITTEE REPORT By Sherm Erickson and Glen Kirschenmann The following people have either been contacted or turned their names into the Nominations Cmmittee:

D.O.H. News by: Frank Haug Well this month's disk may not be the fullest but I'm glad that ALL of the programs WERE member donations. (I knew you guys could do it, you just had to roll up your sleeves and dig in.) Thanks, but you other people don't get off the hook so eas i1y. Speaking of donations .•. I have an idea that might work ~ut nicely for us. I'm sure sme of you own some sort of graphics program for drawing pictures. Now sme of these pictures are pretty good. If enough people donate pictures to make it worth selling, a disk containing these files could be sold as a separate disk. On that same thought those of you who have Electronic Arts' Pinball Construction Set could donate the games you made for another separate disk (The Games themselves not files loaded by it for its use) This will all depend on your support. If you're interested get in touch with me at the meeting. Besides the Dltl we will be selling a separate disk for $4,00. This disk is a S.A.H. tutorial. You must have S.A.M. in order to use it. (For those of you who never heard of S.A.H., it stands for Software Animated Mouth. It is a speech synthesizer that doesn't require extra har!Mare,) Now on with the programs on the November 1985 D.O.M. !.EDIT.INS - Run this program for the instructions to EDIT. 2.EDIT - Amember-written Screen editor, 3.SltlO.BAS - A text simulation of a Sumo-wrestling match. 4.DRAG.BAS - A text simulation of a drag race. 5.SCROLL - ENTER program and type RI.ti (Note your ~rogrm can't use line Oor lines frm 32710 on) to allow ~ou to scroll up and down the listing via - or=. 6.PINBALL.INS - Run this program for the instructions to pinball. 7.PINBALL.OBJ - Will NOT show up on menu, must be loaded without basic frm DOS. RI.ti PINBALL.INS first.

Pres. : Bruce Haug V.P. : Jim Shulz Secty.: Bob Floyd Treas.: Bob Siede Nominations for office will be open before the Elections begin, so if you did not turn your name into the Nminations Committee you still have a chance to run for office. See you at the NEW MEETING PLACE, SEE HAP IN THIS . NEWSLETTER.

USING DISKS WITH BASIC <FOR THE CURIOUS ~LY> By Chris Copeland PART I I Last month we learned how to OPEN and CLOSE disk files and read and write to them. This month we'll look at two powerful disk commandsNOTE and point. They allow you to read and write to any place in the same file. If you have a file opened and say NOTE #1,SECTOR,BYTE in a progra11 line, the number of the current sector and byte being read from or written to will be stored in the variables SECTOR and BYTE <You can use any variable na11e). A sector is the basic unit of data on a disk. There are 720 on a DOS 2 disk. Each one holds 125 bytes of data. When you NOTE #1 1 SECTOR, BYTE you kntM in which sector your record is and on which byte of that sector it begins. If you are using DOS 3, your disks have more than 720 sectors. They are grouped in 'blocks". When you know the sector and byte at which each record begins, you can then POINT to it if you want to read it again:

2\

-4-

POINT #1, SECTOR, BYTE It's that easy, If you keep the values in a table, you can read each record whenever you want. Let's look at a program that will NOTE the locations of each record in an already existing file. Type it in and try it on the file that we created last month with program two. 5 REM PROG~ 3 10 DIM A$(111),TABLE(10,2):TRAP 100 20 ?'Which file to read";:INPUT FILE$ 30 RECORD=1:0PEN #1 1 4,0,FILEt 40 NOTE #1,SECTOR,BYTE 50 TABLE(RECORD,l)=SECTOR 60 TABLE<RECORD,2)=BYTE 70 INPUT #1,A$:?At 80 RECORD=RECORD+1 90 GOTO 40 100 CLOSE #1:REM END OF FILE NIM we know the sector and byte locations of each record, Reading each one will now be a simple matter of looking up its location in TABLE: 110 TRAP 40000:?"Which record of ";FILE$;' to read";:INPUT RECORD 120 SECTOR=TABLE<RECORD,1) 130 BYTE=TABLE<RECORD,2) 140 OPEN #1,4,0,FILEt 150 POINT #1,SECTOR,BYTE 150 INPUT At:? At 160 CLOSE #1 170 GOTO 110 Simple! We used a TRAP 40000 to clear the trap to line 100if something goes wrong, we want to know about it, Now let's write a program that will: 1> Input stuff from the keyboard 2> Write it to a disk file 3) Re-read and edit any record 4) Edit any record in a file by running a routine like program 3 to find it and then writing over the old record using POINT. To do this we're going to have to use a couple of tricks, First, in order to make re-reading and editing individual records easier, we have to ensure that all records are the same length, If some records were only a few characters long, we couldn't edit them to be any longer. Let's use 35 characters, a little less than the width of the screen. Instead of INPUTing frm the keyboard, we-'11 write our own I ittle key-in routine that will demonstrate another use of the OPEN and CLOSE c01111ands and make the program look much more professional. Now that we've got a file that is cmposed of 35-character records, how can we edit it? Well, if we NOTE the location of the file pointer right before we PRINT each record to the file, we'll know where to POINT to re-read

th~t particular record. But once we save the file, our pointers will be lost. To find them again, we will use program three. For simplicity's sake, we'll just have the user re-ty,.,. the I ine to be edited instead of using a complicated editihi,.t routine like a word processor might. Subroutines: Lines 100140: Decide whether to create a file and then edit it or to get the pointers for an existing file and edit that. Lines 200-260 A fancy 1ittle key-in routine that decides what operation to perform and calls the appropriate subroutine. Time to explain that mysterious I ittle OPEN statement in line 10. It opens IOCB #1 to the keyboard, so when we say "GET #1 1 Cttt!AND it puts the ATASCII value of the key pressed into Cttt!AND. Very useful, Lines 300350: Reads the current file to the screen. Depending on which flags have been set, it may print the I ine numners, LPRINT, or just print the I ines. Lines 600680: Edit any record by looking up its location in the table and printing over it. Lines 800860: Create a file. Uses the subroutine at line 1000. Lines 10001090: The lineentering routine. This helps make the program idiot-proof, and prevents the user frm entering control characters in the Jines, We could just replace this whole routine with INPUT LINE$ and the progran would still work, but this is more intersting, Lines 20002040: Find the pointers for the file. Now that we have the capability to create, read, and edit stuff on disk, think of the applications. Just about anything can be stored permanently on diskhave a game keep a permanent record of the top 10 high scoresyou could write a gambling simulation that keeps a permanent record of your bankroll. Or a list of your freinds' phone numbers,,.

10 DIM TABLE<300,2),LINE$(35>,FILE$(20):0PEN #1 1 41 0,"K':POKE 82,0 100 REM*** WHERE TO?*** 110 CLOSE #2:POKE 702 164:? "Edit an existing file? 1 :6ET #1,Cttt!AND:? CHRt(CtttlAND) 120 IF CHR$(Cttt!AN0)= 1 Y1 THEN ? "Filename:';:INPUT FILE$:60SUB 2000:6010 200 130 IF CHRt<CM1AN0><) 1 N1 THEN GOTO 110 140 GOSUB 800 200 REM*** EDIT THE FILE*** 205 REM -GET A Cttt!AND210? :? "File: ";FILE$:? '(R)ead (E)dit (L)ist (P)rint ((Duit ":?

/ -5-

/,20 POKE 702,64:GET 11,Clltmll 225 IF CHR$(ClltfAND)='Q' THEN RLN i30 IF CHR$(ClltfAND)= 1 E1 THEN GOSUB 600 ~40 IF CHR$(ClltfAND)= 1 R1 THEN GOSUB 300 250 IF CHR$(ClltfAND)= 1 L1 THEN LFLAG=1:GOSUB 300 255 IF CHR$(ClltfAND)= P THEN PFLAG=1:GOSUB 300 260 GOTO 210 300 REN -READ FILE TO SCREEN310 CLOSE #2:0PEN #2,4,0,FILES:TRAP 350:LNI.H=l 320 IF LFLAG THEN ? LNl.t1; > LNI.H=LNl.t1+ 1 330 INPUT #2;LINES:? LINES:IF PFLAG THEN LPRINT LINES 340 GOTO 320 350 LFLAG=O:PFLAG=O:A=O:CLOSE #2:RETURN 600 TRAP 680:? 'Edit which record';:INPUT RECORD 610 CLOSE #2:0PEN #2 1 4,0,FILES 620 POINT 12,TABLE(RECORD,1),TABLE(RECORD,2):JNPUT 12,LINES:? :? RECORD;">':? LINES 630? 'Re-type line: 1 :FLAG=-1:GOSUB 1000:FLAG=O 640 CLOSE #2:0PEN 12,12,0,FILES 650 POINT 12,TABLE<RECORD,1),TABLE<RECORD,2):? 670? 12;LINES:GOTO 200 680 CLOSE #2:GOTO 200 800 REN*** CREATE FILE*** 820? :? :? •create a file':? :? •use what filenarte';:INPUT FILES:OPEN 12,8,0,FILES:LNI.H=O:? 1 35 characters per line. 1

1

1

1

;:

I•

I

825? 'Put an 'i' at •.• the start of a new line to end. The .•••• file will be written to the disk as ..••. you type.• ,,.:,)27 REN PERIODS IN ABINE LINE ARE 828 REN SPACES 830 LNI.H=LNl.t1+1:? :? 'Line 1 ;LNl.t1:COL=O 840 GOSUB 1000:IF DINE THEN RETURN 850 NOTE B2,SECTOR,BYTE:TABLE<LNl.t1,1)=SECTOR:TABLE<LNl.t1,2)=8YTE 860? 12;LINES:GOTO 830 1000 REN*** TYPE A LINE OF TEXT*** 1010 GET 11,A:IF A=l26 ~D COL>O THEN LINES(COL,COL>="":COL=COL-1:? CHR$(A);:GOTO 1000 1020 IF A=155 THEN GOTO 1070 1030 IF A=ASC( 1 i 1 ) ~D COL=O THEN DINE=l :RETURN 1040 IF (A)27 ~D A<32) OR (A)124 ~D A<128) OR (A)155 ~D A{160) OR A>253 THEN? 1 [8UZZERl 1 ;:GOTO 1000 1050 COL=COL+1:LINES<COL,COL>=CHR$(A):? CHR$(A);:IF COL=35 THEN 1070 1060 GOTO 1000 1070 IF COL<>35 THEN FOR LOOP=COL+l TO 35:LINES(LOOP,LOOP>=• ":NEXT LOOP 1080 COL=O:RETURN 1090 IF FLAG=-1 THEN RETURN 2000 REN**** GET FILE POINTERS*** 2010 CLOSE #2:0PEN #2,4,0,FILES:COOO=l:TRAP 2040 ~~

Nm

12,SECTOR,BYTE:TABLE(C000,1)=SECTOR:TABLE(C000,2>=BYTE ~030 INPUT 12,LINES:COOO=COOO+l:GOTO 2020 ~040 RETURN

We are n<M going to expand the model of the 6502 that have been using. Until n<M, the 6502 I have described nothing more than a status register, program counter, accumulator. N<M I am going to reveal the existence of new registers in the 6502: the Xand Y-registers.

you had and two

These two registers are eight-bit registers just like the accumulator. You can load numbers into them and store them out just as you can with the accumulator. You cannot do arithmetic or Boolean operations with them as you can with the accumulator. But you can do a number of very special things that greatly increase the p<Mer of the 6502. Let's start with the simple move instructions. The first are LDX and LDY, which load the Xand Y-registers the same way that LDA loads the accumulator. Then there are STX and STY, which store the Xand Y-registers the sa111e way that STA stores the accumulator, There are also four connands for transferring bytes between registers; these are TAX (transfer A to X), TAY (transfer A to Y), TXA (transfer X to A), and TYA (transfer Y to A). Then there are four special instructions that you will use very often. These are INX and INY, which increment (add one to) the Xand Y-registers, and DEX and DEY, which decrement (subtract one frm) the X-and Y-registers. Finally, we have the CPX and CPY C!Xllands, which c011pare X or Y with the operand of the instruction. These two instructions operate in exactly the same way that the CNP instruction works, except that they use the Xand Y-registers instead of the accumulator. What are these two registers used for? Well, they are s011etimes used as temporary registers. If you are in the middle of a lengthy c011putation, and you need to save a value currently in the accumulator to make ro011 for s011ething else, the Xand Y-registers are a handy place to stuff values away for temporary storage. Progranners do this all the time. H<Mever, temporary storage is not the real purpose and vaue arise frcn their utility as index registers. Index registers go hand in hand with loops; the best way to show you how they are used is to dump the whole schlleer at once and then explain it. So consider the foll<Ming problem: your program has to deal with the possibility of user errors. Suppose you require the user ty type in a file name for your program to read, What happens if this file is not on the disk? You have to put an error message on the screen that says, 'FILE NOT IN DISK!' How do you print the message? Here's a saraple bit of code that will do it:

LDX l<ENDHSG-ERRNSG-1> LOOP1 LDA ERRNSG,X STA SCREEN,X SEC SBC IK2D DEX BPL LOOP1 JMP ELSWHR ERRNSG DB 'FILE NOT ON DISK1-' ENDHSG DS 1 Let's take apart this code and explain it step by step. First thing we do is load the X-register with the number of characters (minutes one) in the message. The expression <ENDMSG-ERRNSG-1) will calculate that length at assembly time. This turns out to be 17 characters long. If we were pedestrian about it we could have just written LDX 116, but this way, if we decide to change the message we don't have to remember to go back and change the LDX connand. Neat, huh? OK, so now we have a 16 in the X-register. Now the 65D2 comes to the next connand -- LDA, ERRNSG,X. This coinand tells it to load the accumulator with the byte at (address ERRNSG, indexed by X). What this means is as follows: the 65D2 will take the address ERRNSG and add the value of the x-register to that address. It will then go to the address so calculated and load the acc1111ulator with the contents of that address. Since X contains a 16, the 6502 will go to the 16th byte after the first byte in the table ERRNSG. If you count characters, you will see that the 16th byte is the exclamation point. So the 65D2 will load the ASCII code for an exclamation point into the accumulator. The next two instructions <SEC, SBC IK2D) are necessary to correct for the Atari's nonstandard handling of ASCII codes. They make sure that the exclamation will be printed on the screen as an exclamation point. The next instruction <STA SCREEN,X) stores the resit indexed by X. The 65D2 will add the contents of X (still 16) to the address SCREEN. It will then store the contents of the accU11ulator into that address. If that address is part of screen RAH, then you will see an exclamation point appear on the screen. The next instruction that the 65D2 encounters is the DEX instruction. This instruction subtracts one frcrn the X-register, making it a 15, Next, the 65D2 comes to the instruction BPL, LOOP 1. This will branch if the N-flag is clear. The vaue of the N-flag is affected by a DEX instruction. The value of bit D7 of the result is transferred to the N-flag. Bit Dd7 of 15 is a zero, hence the N-flag is clear, hence the 65D2 will indeed take the branch, Note that it branches back up to LOOP 1, Now it will repeat the process, only this time X contains a 15, not a 16, It will therefore grab the 15th character, an ASCII 'K', and store that to the screen position just

be!ore the ml•nlion point.

Then ii will subtract~

form X to get a 14, and will continue the loop. This process will continue, with the 6502 grabbing byt"-in reverse order form the table and storing them onto the screen, until after the 6502 does the seroth byte, When X contains a zero, and the 6502 executes a DEX, it obtains the result $FF. This sets the N-flag, When the 6502 encounters the BPL connand, it will NOT take the branch; instead, it will skip the branch and go on to the JHP statement. The loop is terminated. In this one fragment of code you have seen two major ideas: indexed addressing and looping. They are so closely related that it is hard to talk about one without talking about the other. You can use indexed addressing with either the X-register or the Y-register. You most connonly use indexed addressing with the LDA and STA connands, but you can also use it with many of the other 6502 connands: ADC, SBC, CHP, AND, ORA, EOR, LSR, ROR, AOL, and ROL can all be used with indexed addressing. Indexed addressing alllMs you to work with tables or arrays of data. There is one ugly catch: all of your arrays must be less than 257 bytes long, because the index registers are only eight bits wide. Host of the time this is not a serious problem. HCMever, if you must address a larger table r array, you can use indirect addressing. To do this, yo"' calculate the address that you desire to access, store that address in two contiguous bytes on page zero (ICM, then high) -- we call these two bytes a pointer -- and then refer to the pointer like so: ·LDA

(POINTER>, Y

This instruction will take the address out of pointer, add the value of Y to it, and load the accumulator with the contents of the address so calculated, If POINTER contains $4567 and Y contains a 2, then the 6502 will load the acumulator with the contents of address $4569. You are still restricted by the size of Y, but you can always go back and change the POINTER if you need to span larger arrays, In this case, you frequently just leave Y equal to zero and do all of your indexing directly with changes to POINTER. The last topic I will take up is termination techniques. Every loop must s0111ehCM be terminated if you are to avoid the problem of the Sorcerer's Apprentice. You will note that the prograining example I gave used a rather odd approach. I started at the end of the array and worked backwards, Why not start at the beginning and work forwards? It's slightly more efficient going backwards than forwards. When you go forwards, you have to terminate the loop with:.._,. INX

CPX BNE

117 LOOP!

Whereas when you go backwards, you need only use: DEX

BPL

LOOP!

~ Going backwards you

save one instruction, HCMever, if this confuses you, feel free to count forward; that works, too, only it's a little less efficient. There is also a problem on choosing whether to BNE or BPL. BPL restricts you to a range of only 127 bytes, but BNE, but index frm ERRNSG-1 and SCREEN-1 instead of ERRNSG and SCREEN, There are lots of other sneaky ways to ter11inate loops, but they fall into advanced topics,

MC68000

MOTOROLA'S 16/32 BIT MICROPROCESSOR by SIG-ATARI's Tim Barr

repri'"'tecl

from

;YfACE

...lAttention all you hackers out there! Are you anxious to get at the new ST Line of Atari Computers? Here's a little background info about the heart and soul of these new computers. This artide was taken from the SIG Atari section of CompuServe.] The MC68000 is a 16-bit MPU with 17 general purpose 32-bit registers, a 32-bit program counter and a 16-bit status register. The first eight GP registers (D0-D7) are used as data registers. The next seven GP registers CA0-A6> and the system stack pointers can be utilized as address registers and pointers for software use. The data registers can be used for different data sizes. These sizes are: BYTE (8-bit), WORD <16-bit), and LONG WORD (32-bit) operations. The MPU has a 24-bit address bus (actually it is 23-bit address line and a HI BYTE and LOW BYTE select lines which gives you 8 megawords or 16 megabytes of memory) and a 16-bit data bus. Five basic data types are supported by the instruction set. These data types are: BITS, '3CD DIGITS (4-bits>, BYTES (8-bits>, WORDS --'<16-bits>, and LONG WORDS (32-bits). The MPU has 14 address modes of six basic types: REGISTER DIRECT, REGISTER INDIRECT, ABSOLUTE, PROGRAM COUNTER RELATIVE, IMMEDIATE, and IMPLIED. The surprising

thing about the 68000 is that it only has 56 instruction types and a total of only 88 actual instructions. The actual 16-bit OP-CODE that the system uses is a combination of an instruction and an addressing mode, GP register number, an OP-MODE, instruction specific data, or any combination of the four. <Instruction specific data is such information as shift direction, branch conditions, operation size, etc.> This provides you with over 1000 acutal instructions, but keeps the total number of instructions small. I will try to upload a list of the basic instructions of the 68000 [ to. CompuServe J, but I wanted to mention a few of them here. The MPU can perform add and subtract functions on BCD digits in groups of two digits. It can also multiply and divide binary numbers in these formats: 32-bit / 16-bit =) 32-bit and 16-bit * 16-bit =) 32-bit. The s"igned divide is the slowest instruction to execute on the 68000. It takes 170 dock cydes or 21.25 microsec. at a dock speed of 8 MHZ. This means that you could divide any 32-bit number in memory by any 16-bit number in memory over 47,000 times in ONE SECOND!! I hope that this has given you a general idea of the power. of the processor that the new Ataris will be using. If you are interested in more information, I would like to suggest a couple of books that are available. The first is published by Howard K. Sams & Co. and is called "68000: PRINCIPLES AND PROGRAMMING" by Leo Scanion. You should be able to order this book through the Howard Sams section of CompuServe (GO SAM). The second book I would like to recommend is "M68000 PROGRAMMERS REFERENCE MANUAL" available from: Motorola Semiconductor Products Inc. P.O. Box 20912 Phoenix, AZ 85036 Ask for document t: M68000UMCAD4).

SPAC.E

Fa.lu.._ d-011

lfb_-/;;"j

P/Q.ce.

Htifts Co....,,..... Q ...·b~1" LQ.~fQ.."'b~... A"e.. W.

Tl.e_

rol;c.e._ ;. +\,..c.

Je.tl's

arc-c. .....

\,\.13 u

St. Paul ATARI Camputtr Enthusiasts 2589 Fisk St. Rostvillt,,.. 55113

J. P. Scheib 3944 24th Av. S. Minneapolis, Mn.

55406

Oil...

.s,....tt.

-~i"-5.