home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / text / hints / volume_02 / issue_02 < prev    next >
Text File  |  1995-02-16  |  31KB  |  902 lines

  1.  
  2.  
  3. Å   Mannisman Tally printers with serial interface Ö Pin connections
  4. are: pins 1, 4 and 6 linked together on the Archimedes, pin 3 to pin 3
  5. on the printer, pin 5 to pin 7 on the printer and pin 8 to both pins 11
  6. and 19 on the printer.
  7. 2.2
  8. Å   SWI öXOS...ò Ö If you are using SWI öXOS...ò commands so that you
  9. can handle your own errors, it will fail if you try to return
  10. immediately after this command to the calling routine. A dummy instruc
  11. tion needs to be inserted before the LDMFD instruction. Presumably a
  12. Éfeatureæ of OS 1.2.
  13. 2.2
  14. Å   Problems with *Memory and *MemoryI Ö If you try to use these two
  15. commands in the debugger with the aim of dumping to printer, you will
  16. find that codes above &7F are not weeded out Ö they are all sent to the
  17. printer regardless which can cause all sorts of problems. The following
  18. program patch will solve the problem.
  19. 2.2
  20.  10 REM> DEBUGPCH
  21. 2.2
  22.  20 REM (C) JW^2 4th OCTOBER 1988
  23. 2.2
  24.  30 DIM A% &270C
  25. 2.2
  26.  40 OSCLIöSAVE Debugged_D 38486A0
  27. 2.2
  28.  +270Cö
  29. 2.2
  30.  50 OSCLIöLOAD Debugged_D ò+STR$~A%
  31. 2.2
  32.  60 FOR F=0 TO 3 STEP 3
  33. 2.2
  34.  70   P%=A%+&2230
  35. 2.2
  36.  80   [
  37. 2.2
  38.  90   OPT F
  39. 2.2
  40. 100   STMDB R13!,{r0-r9 ,R14}
  41. 2.2
  42. 110   .LOOP
  43. 2.2
  44. 120   LDRB  R0,[R9],#1
  45. 2.2
  46. 130   CMP   R0,#&7F
  47. 2.2
  48. 140   MOVHS R0,#&2E
  49. 2.2
  50. 150   CMP   R0,#&1F
  51. 2.2
  52. 160   MOVLS R0,#&2E
  53. 2.2
  54. 170   SWI   öXOS_WriteCò
  55. 2.2
  56. 180   BVS   (LOOP+&35D)
  57. 2.2
  58. 190   SUBS  R2,R2,#1
  59. 2.2
  60. 200   BNE   LOOP
  61. 2.2
  62. 210   ]
  63. 2.2
  64. 220 NEXT
  65. 2.2
  66. 230 OSCLIöSAVE Debugged_D ò+STR$~A%+
  67. 2.2
  68. ö +270Cò
  69. 2.2
  70. 240 OSCLIöSETTYPE Debugged_D &FFAò
  71. 2.2
  72. Å   EDITæs disappearing cursor Ö If you use Éoptionsæ (<shift-f3>), you
  73. can change to a non-flashing cursor which is visible all the time, and
  74. you donæt have to change it each time you switch on the machine because
  75. EDIT stores its options in cmos ram. (Anyone know if thereæs a way to
  76. re-program it to change the colour of the cursor?)
  77. 2.2
  78. Å   Putting sound through the monitor Ö It is perfectly possible to put
  79. the sound output from the 3.5mm stereo jack socket on the Archimedes
  80. through the amplifiers and speaker(s) of both the standard Acorn colour
  81. monitor and also the Phillips CM8833. All you need is a piece of twin
  82. screened cable (though actually I used ordinary thin three core mains
  83. flex which is OK for such a short length) and a 3.5 mm stereo jack plug
  84. (RS Components 274Ö284, ú1.19 for two). The SCART plug connections are
  85. that pin 2 is right audio, 4 is earth and 6 is left audio. The pins
  86. should be numbered, but if not, 2, 4 and 6 are the first three pins
  87. along the long edge of the plug starting from the rectangular end.
  88. 2.2
  89. Three possible problems: firstly, you may find that the SCART plug has
  90. no pins at positions 2, 4 and 6 in which case you will have to buy a new
  91. plug (Tandy N╝ 15Ö7030, ú1.49 each) and re-wire the other connections.
  92. Secondly, you may find that your cable doesnæt fit through the space
  93. available for the cable entry in the SCART plug Ö in which case, some
  94. judicious hacking of the plastic is needed. Finally, if the SCART plug
  95. has got pins at 2, 4 and 6, you may not be able to get at them to solder
  96. onto them. The solution here is to push each of the three pins back out
  97. through the body of the plug, solder them then push them back in again.
  98. It sounds easy but itæs not Ö there are little barbs the stop the pins
  99. being pushed out so you have to try to manipulate these and push the
  100. pins out at the same time Ö OK if you have three hands!
  101. 2.2
  102. The result Ö If the kids want to play Orion at full volume, they can,
  103. but I can turn it back down to a sensible volume when I use the system.
  104. 2.2
  105. Å   Stereo Speakers Ö I recently followed the suggestion in Archive 1.2,
  106. page 7 and purchased the amplified speakers (Model 40-1259E) from a
  107. local Tandy store. Initially I also purchased a couple of mains adaptors
  108. to power each unit but I found that this caused a considerable mains hum
  109. through both speakers. Upon returning to the Tandy store, I was advised
  110. that hum was caused by the mains adaptors not being earthed and, rather
  111. than spending more money on earthed mains adaptors, I exchanged the
  112. original adaptors for re-chargeable batteries which seem to work fine Ö
  113. there are also fewer wires trailing around! Whilst the stereo effect is
  114. very good, there is a problem in that there is no volume control fitted
  115. to these speakers; the suggestion from one of the staff at Tandy was to
  116. wire in two of their öL-Pad Speaker Level Controlsò. Have any other
  117. Archive readers tried this or come up with a different solution?
  118. 2.2
  119. I have found that by amending the *Configure SoundDefault middle
  120. parameter to a lower value than 7, the volume can be reduced, this does
  121. provide some measure of control of sound volume; these parameters can
  122. take a value of 0 to 7 with each unit corresponding to one eighth of the
  123. overall maximum volume (see PRM, page 537).
  124. 2.2
  125. Å   Monitor problems (with solutions!) Ö Fujitsu and MAG 14C Ö The
  126. problem began on the MAG with a distortion of the top few lines of the
  127. display when in a multisync mode. The nature of this problem suggested
  128. that the monitor took several scan lines to lock onto the composite sync
  129. signal fed to it from the Archimedes. It was decided to feed it with
  130. separate vertical (frame) and horizontal (line) sync signals, which
  131. necessitated having to alter the preset links 10 and 11 within the
  132. Archimedes. At present this involves cutting a track (Lk10) and
  133. inserting a link (Lk11), since these links are not brought out on the
  134. normal Molex type links. Having done this modification you need a
  135. *Configure Sync 0 to set ÉVertical sync onlyæ instead of ÉComposite
  136. syncæ to the monitor, otherwise the display rolls (indicating lost frame
  137. sync). This then cured the screen distortion problem but because of the
  138. way Acorn have put Composite/Vertical sync on the green signal, it kills
  139. the green output. With much trepidation this problem was overcome by
  140. disabling Acornæs implementation of this signal by cutting pin 2 of IC
  141. 4. The result is a perfect picture.
  142. 2.2
  143. The Fujitsu monitor problem was much simpler and cured far easier after
  144. the troubles with the MAG.
  145. 2.2
  146. Although the picture quality was very good, there was an excess of
  147. green, even though R39 had been removed (see Archive 1.3 p8) It was
  148. originally thought that some internal adjustment of the green gun was
  149. needed but, with the experience of MAG monitor (and having tried it on
  150. the modified sync signal from the green output) the link changes proved
  151. unnecessary as the monitor worked perfectly happily with composite sync.
  152. Again the result was a perfect picture.
  153. 2.2
  154. Anyone wanting further information on this modi-fication can either
  155. contact Reg Dalton on 0742 487992 (less technical/Evenings only) or
  156. Steve Bass (who did all the work) on 0742 708028 (Daytime) or 0742
  157. 886622 (Evenings).
  158. 2.2
  159. Å   Screen saving from the SCML Teletext adaptor Ö R L Jefferies has
  160. worked out how to dump screens from the SCML Teletext Adaptor. (Pressing
  161. the ÉSæ command option gives an error but SCML have not replied to his
  162. questions about that yet.) He has utilised Robin Newmanæs mode 7 to mode
  163. 9 utility as supplied on program disc 1.10. He copied this into the
  164. library directory on the Teletext disc and then created a mode 7 to mode
  165. 9 screensave module using Neil Strongæs öPrintkey screen dumpò (issues
  166. 1.10 p 45 and 1.11 p 7). Two lines need altering in the source program:
  167. 2.2
  168. line 840 should be changed to cmp r0,#83 and line 920 should be equs
  169. öM7M9 screensave scr<file>ò
  170. 2.2
  171. Note that you should *SETEVAL file XX before you load the öSò key module
  172. and before executing the Teletext module. One small niggle is that Robin
  173. Newmanæs module returns with the cursor ON. Is there an easy way to get
  174. rid of this?
  175. 2.2
  176. Å   Bug in C Ö Karl Strickland writes╔ There appears to be a bug in the
  177. fgets() function in version 1.54A (latest public release) of ANSI C. 
  178. Instead, use the function given below and declare it using
  179. 2.2
  180. char *xfgets (char*,int,FILE*);
  181. 2.2
  182. We have to use xfgets (as opposed to fgets) because the linker gets
  183. confused if it finds the same function declared twice.
  184. 2.2
  185. char* xfgets (char* a,int b,FILE *s)
  186. 2.2
  187. {2 .2
  188.    int c,d;
  189. 2.2
  190.    *a=NULL;     /* Must include STDIO.H */
  191. 2.2
  192.    for (c=0;c<b;c++) {2 .2
  193.       d=fgetc(s);
  194. 2.2
  195.       if (d==EOF)
  196. 2.2
  197.          return NULL;
  198. 2.2
  199.       else
  200. 2.2
  201.          if (d==13)
  202. 2.2
  203.             return a;
  204. 2.2
  205.          else
  206. 2.2
  207.             strncat(a,(char*)&d,1);
  208. 2.2
  209.    }
  210. 2.2
  211.    return a;
  212. 2.2
  213. }
  214. 2.2
  215. Å   A hint for Twin from Bj┐rn Fl┐tten Ö When using Twin to edit large
  216. BASIC programs you can easily run out of memory. (Twin complains by
  217. hanging up the computer when called.) This is because of the inconveni
  218. ent way Twin is called from BASIC. Because Twin works on ASCII files,
  219. BASIC has to expand the current program from tokenised form to ASCII.
  220. This copy is placed on top of the BASIC program and is maybe 20-30%
  221. larger than the original. Then Twin is called and makes a new copy of
  222. the program which it places on top of itself. This means that an
  223. unnecessary lot of memory is used.
  224. 2.2
  225. One solution is to let Twin run from the address of PAGE. This works
  226. because Twin is not loaded into memory before the BASIC program is
  227. expanded. However, you will have to ensure that the BASIC program is
  228. bigger than Twin, if not, Twin will be loaded over the expanded version
  229. of your program.
  230. 2.2
  231. (This unfortunately makes the problem of Twin not releasing some vectors
  232. worse. This means that these vectors will point into the middle of your
  233. BASIC program after exiting from Twin. Use reset after exiting to BASIC 
  234. and then OLD, to cure this.)
  235. 2.2
  236. Å   Problems with (Master) EDIT Ö If you get rubbish when you load up
  237. the EDIT ROM image from the BBC Master into the 6502 emulator, try
  238. loading it with:
  239. 2.2
  240. *65arthur
  241. 2.2
  242. *GO F800
  243. 2.2
  244. *EDIT
  245. 2.2
  246. Å   From Arthur to BASIC Ö If you are in the Arthur supervisor and you
  247. type *Progname where Progname is a BASIC program, it will run the
  248. program and drop you back out into the supervisor (equivalent to *BASIC
  249. Öchain Progname). However, if you *LOAD Progname, it switches to BASIC,
  250. loads the program and gives you back control with a É>æ prompt Ö
  251. equivalent to *BASIC Öload Progname but shorter to type and certainly
  252. easier than *BASIC followed by LOAD öPrognameò. If you do a *SHOW, you
  253. will see the filetype definitions which make sense of it all.
  254. 2.2
  255. Å   Sprites and Sprite Commands Ö Paul White-horn writes╔ The Sprite
  256. Editor on the Welcome disc does not work properly being unable to create
  257. masked sprites (those with a transparent back-ground) or to save shades
  258. of colour that have been set up in the various edit modes. For many
  259. board style games this is not an insuperable difficulty and for chess
  260. and checkers, mode 1 creates reasonably detailed sprites in red, yellow,
  261. black and white.
  262. 2.2
  263. The simplest way of getting your own sprites from the Welcome disc onto
  264. your game or program disc is to *SNEW to wipe out anything that can be
  265. called a sprite in RAM, *SLOAD (by name or number) your sprite or sprite
  266. file into the machine from the Welcome disc (you donæt need to be in the
  267. Sprite Editor to do this), take out the Welcome disc, insert your game
  268. disc, *MOUNT it and *SSAVE (name) the contents of the machineæs RAM.
  269. Whatever sprites you have in RAM at this point will all go into a file
  270. created and named by the *SSAVE command and will be placed on your own
  271. disc.
  272. 2.2
  273. To check that they are all safely installed on your game disc *SNEW
  274. again (to clear RAM) and *SLOAD (name) the sprite(s) you have just
  275. *SSAVEæd on your disc. Now typing *SLIST will bring up a list of ALL the
  276. sprites in RAM which should correspond to the ones you have just
  277. transferred from the Welcome disc. At this point you can rename the
  278. sprites you see listed before you but the syntax for the *SRENAME
  279. command is not as it appears in the User Guide. Type *SRENAME (oldname)
  280. (newname) without commas or other punctuation marks separating the two
  281. names and without any quote marks round the names. This renames sprites
  282. in RAM and if you want these new names preserved on your disc then they
  283. must be *SSAVEæd collectively back to disc and you can  save them with a
  284. different file name if you wish.
  285. 2.2
  286. *SDELETE (name) deletes a sprite in RAM whereas *DELETE (name) deletes a
  287. sprite (or file of sprites) on disc. Having weeded out sprites you donæt
  288. require with *SDELETE it is best to *SSAVE those you do need (possibly
  289. with a new file name) and *SNEW to clear RAM before proceeding further.
  290. This way you will not have rogue sprites lurking in RAM or in files on
  291. your disc where they may be called by default if they have the same name
  292. or number as the new ones.
  293. 2.2
  294. To create files of sprites from different sources you can use *SMERGE
  295. which merges a sprite (or file of same) from disc with those already
  296. installed in RAM. Those coming from disc have priority so if you have
  297. two sprites with the same name or number, the one on the disc will
  298. overpower its namesake in RAM. This command seems a little haphazard on
  299. my 310 especially with sprites which are numbered and occasionally
  300. several tries are needed to make it happen as required.
  301. 2.2
  302. If you intend to choose sprites during the course of your game as a
  303. consequence of numerical operations then it is necessary to use numbers
  304. as names so that they can be called with the VDU command. The VDU call
  305. takes variables with a range between 0 and 255 so make sure your sprites
  306. donæt exceed this range.
  307. 2.2
  308. *SINFO prints the size of the sprite workspace and *SCOPY (oldname)
  309. (newname) copies the named sprite. *SGET picks up a portion of the
  310. screen as a sprite but for details of this see the User Guide.
  311. 2.2
  312. Å   EMR SoundSynth + CC ROM podule Ö There has been a problem of a clash
  313. between EMRæs SoundSynth and Computer Conceptsæ ROM/RAM podule in that
  314. after using SoundSynth, the contents of the RAM filing system disap
  315. peared! (Fortunately, I had a recent backup!) EMR have been looking into
  316. the problem and have sorted it out. If you have had the same problem,
  317. return your disc to EMR and they will replace it öin most cases, free of
  318. chargeò.
  319. 2.2
  320. Å   Loading palette files Ö Here is a simple BASIC program to load a
  321. ö!Paletteò file and set the palette up. The file format really is
  322. simple: 3 bytes are stored for each colour Ö red, green and blue
  323. respectively. This group of 3 bytes is repeated for all 20 colours saved
  324. Ö logical colours 0-15, the border, and mouse colours 1-3.
  325. 2.2
  326.  10 REM >TestPal
  327. 2.2
  328.  20 REM ===> To demonstrate reading a
  329. 2.2
  330.  30 REM ===> Desktop !Palette file
  331. 2.2
  332.  40 REM By John Smith, September 1988
  333. 2.2
  334.  50 REM
  335. 2.2
  336.  60 MODE 12 :REM Any 16-colour mode
  337. 2.2
  338.  will do.
  339. 2.2
  340.  70 :
  341. 2.2
  342.  80 REM Put all 16 colours on screen,
  343. 2.2
  344.  and a 2-colour mouse pointer.
  345. 2.2
  346.  90 FOR x%=0 TO 15
  347. 2.2
  348. 100   GCOL x%
  349. 2.2
  350. 110   RECTANGLE FILL x%*80,0,80,1023
  351. 2.2
  352. 120 NEXT
  353. 2.2
  354. 130 MOUSE ON
  355. 2.2
  356. 140 *POINTER 1
  357. 2.2
  358. 150 PRINTTAB(0,0);öNow press a key to
  359. 2.2
  360.  load the É!Paletteæ fileö
  361. 2.2
  362. 160 dummy=GET
  363. 2.2
  364. 170 :
  365. 2.2
  366. 180 REM Now load the palette file.
  367. 2.2
  368. 190 handle%=OPENIN ö!Paletteò
  369. 2.2
  370. 200 REM Do östandardò colours first.
  371. 2.2
  372. 210 FOR loop%=0 TO 15
  373. 2.2
  374. 220   COLOUR loop%, BGET#handle%,
  375. 2.2
  376.  BGET#handle%, BGET#handle%
  377. 2.2
  378. 230 NEXT
  379. 2.2
  380. 240 :
  381. 2.2
  382. 250 REM Screen Border
  383. 2.2
  384. 260 VDU 19,0,24, BGET#handle%,
  385. 2.2
  386.  BGET#handle%, BGET#handle%
  387. 2.2
  388. 270 :
  389. 2.2
  390. 280 REM Mouse colour 1
  391. 2.2
  392. 290 MOUSE COLOUR 1, BGET#handle%,
  393. 2.2
  394.  BGET#handle%, BGET#handle%
  395. 2.2
  396. 300 MOUSE COLOUR 2, BGET#handle%,
  397. 2.2
  398.  BGET#handle%, BGET#handle%
  399. 2.2
  400. 310 MOUSE COLOUR 3, BGET#handle%,
  401. 2.2
  402.  BGET#handle%, BGET#handle%
  403. 2.2
  404. 320 CLOSE#handle%
  405. 2.2
  406. Å   InterWord to ArcWriter Ö if you have InterWord files from BBC days
  407. and want to transfer them to ArcWriter, look in the First Word Plus
  408. hints below where the transfer to FWP is achieved by transferring first
  409. to ArcWriter.
  410. 2.2
  411. Å   Double-precision to BBC BASIC Ö following on from the floating point
  412. BCD to BBC BASIC conversion program published in Archive 1.11, page 32,
  413. Carl Cepurneek has done a routine which converts from the more efficient
  414. Double-precision reals to BBC BASIC.
  415. 2.2
  416. 10 REM>Carl - FPU number conversion
  417. 2.2
  418. 20 REM BBC BASIC V to FPU memory
  419. 2.2
  420. 30 REM format conversions
  421. 2.2
  422.  40 REM Packed decimal print routine
  423. 2.2
  424.  50
  425. 2.2
  426.  60 REM Carl P.Cepurneek 26 Clyde St
  427. 2.2
  428.  70 REM Parkside, S.A.5063,Australia
  429. 2.2
  430. 100
  431. 2.2
  432. 110 DEFPROCcvt_s(bbc,adr) :REM from
  433. 2.2
  434.  BBC real at |bbc to FP at adr
  435. 2.2
  436. 120 LOCAL exp%,sign%,mant%
  437. 2.2
  438. 130 !adr=0:adr!4=0   :REM clear
  439. 2.2
  440. 140 IF |bbc=0:!adr=0:ENDPROC
  441. 2.2
  442. 150 exp%=(bbc?4)-&80 :REM get
  443. 2.2
  444.  adjusted exponent
  445. 2.2
  446. 160 IFexp%>0 exp%=exp%+126 ELSE exp%=
  447. 2.2
  448. 126-ABS(exp%)
  449. 2.2
  450. 170 !adr=!adr OR exp%<<23:REM set
  451. 2.2
  452.  exponent bits
  453. 2.2
  454. 180 sign%=!bbc AND &80000000
  455. 2.2
  456. :REM isolate sign bit
  457. 2.2
  458. 190 !adr=!adr OR sign%:REM set sign bit
  459. 2.2
  460. 200 mant%=!bbc AND &7FFFFFFF :REM
  461. 2.2
  462.  clear neg bit if set
  463. 2.2
  464. 210 !adr=!adr OR mant%>>>8:REM set
  465. 2.2
  466.  mantissa
  467. 2.2
  468. 220 ENDPROC
  469. 2.2
  470. 230
  471. 2.2
  472. 240 DEFPROCcvt_d(bbc,adr):REM from
  473. 2.2
  474.  real at address bbc
  475. 2.2
  476. 250 LOCAL exp%,sign%,mant%
  477. 2.2
  478. 260 !adr=0:adr!4=0
  479. 2.2
  480. 270 IF |bbc=0:!adr=0:ENDPROC
  481. 2.2
  482. 280 exp%=(bbc?4)-&80 :REM get
  483. 2.2
  484.  adjusted bbc exponent
  485. 2.2
  486. 290 IF exp%>0 exp%=exp%+1022 ELSE exp%
  487. 2.2
  488. =1022-ABS(exp%)
  489. 2.2
  490. 300 !adr=!adr OR exp%<<20
  491. 2.2
  492. 310 sign%=!bbc AND &80000000
  493. 2.2
  494. :REM isolate sign bit
  495. 2.2
  496. 320 !adr=!adr OR sign%:REM set sign bit
  497. 2.2
  498. 330 mant%=!bbc AND &7FFFFFFF
  499. 2.2
  500. :REM clear sign bit set
  501. 2.2
  502. 340 !adr=!adr OR mant%>>>11 :REM set
  503. 2.2
  504.  mantissa msbits
  505. 2.2
  506. 350 mant%=mant%<<21 :REM shift over
  507. 2.2
  508.  low bits
  509. 2.2
  510. 360 adr!4=adr!4 OR mant%  :REM set
  511. 2.2
  512.  mantissa lsbits
  513. 2.2
  514. 370 ENDPROC
  515. 2.2
  516. 380
  517. 2.2
  518. 390 DEFPROCcvt_e(bbc,adr):REM from
  519. 2.2
  520.  BBC real at |bbc
  521. 2.2
  522. 400 LOCAL exp%,sign%,mant%
  523. 2.2
  524. 410 !adr=0:adr!4=0:adr!8=0 :REM clear
  525. 2.2
  526.  destination
  527. 2.2
  528. 420 IF |bbc=0:!adr=0:ENDPROC
  529. 2.2
  530. 430 exp%=(bbc?4)-&80 :REM get
  531. 2.2
  532.  adjusted exponent
  533. 2.2
  534. 440 IFexp%>0 exp%=exp%+16382 ELSE
  535. 2.2
  536.  exp%=16382-ABS(exp%)
  537. 2.2
  538. 450 !adr=!adr OR exp%  :REM set
  539. 2.2
  540.  exponent bits
  541. 2.2
  542. 460 sign%=!bbc AND &80000000  
  543. 2.2
  544. :REM isolate sign bit
  545. 2.2
  546. 470 !adr=!adr OR sign%:REM set sign bit
  547. 2.2
  548. 480 mant%=!bbc OR &80000000  :REM set
  549. 2.2
  550.  top bit (J)
  551. 2.2
  552. 490 adr!4=adr!4 OR mant% :REM set
  553. 2.2
  554.  mantissa
  555. 2.2
  556. 500 ENDPROC
  557. 2.2
  558. 510
  559. 2.2
  560. 520 DEFFNprint_packed(base%)
  561. 2.2
  562. 530 LOCAL ms%,ms$,es%,es$,m%,s%
  563. 2.2
  564. 540 @%=&00001
  565. 2.2
  566. 550 m%=(!base% AND &80000000)>>>31
  567. 2.2
  568. 560 IF m%=0 ms$=ö+ò ELSE ms$=ö-ò
  569. 2.2
  570. 570 PRINT ms$;
  571. 2.2
  572. 580 m%=(!base% AND &F<<8) >>>8
  573. 2.2
  574. 590 PRINT m%;ö.ò;
  575. 2.2
  576. 600 FOR s%=4 TO 0 STEP -4
  577. 2.2
  578. 610   m%=(!base% AND &F<<s%) >>>s%
  579. 2.2
  580. 620   PRINT m%;
  581. 2.2
  582. 630 NEXT
  583. 2.2
  584. 640 FOR w%=4 TO 8 STEP 4
  585. 2.2
  586. 650   FOR s%=28 TO 0 STEP -4
  587. 2.2
  588. 660     m%=(w%!base% AND &F<<s%) >>>s%
  589. 2.2
  590. 670     PRINT m%;
  591. 2.2
  592. 680   NEXT
  593. 2.2
  594. 690 NEXT
  595. 2.2
  596. 700 e%=(!base% AND &40000000)>>>30
  597. 2.2
  598. 710 IF e%=0 es$=ö+ò ELSE es$=ö-ò
  599. 2.2
  600. 720 PRINTö Eò;es$;
  601. 2.2
  602. 730 FOR s%=24 TO 12 STEP -4
  603. 2.2
  604. 740   m%=(!base% AND &F<<s%) >>>s%
  605. 2.2
  606. 750   PRINT m%;
  607. 2.2
  608. 760 NEXT
  609. 2.2
  610. 770 =öò
  611. 2.2
  612. Å   Using 40-track drives Ö If you have a 40 track 5.25ö drive as used
  613. on PC clones, you can use it under the PC emulator but, in native
  614. Archimedes ADFS modes you will have problems. To get round it, format
  615. the disc as normal then, when it goes beyond öFormatting 40ò and starts
  616. clicking as it reaches the end of the travel on the head movement, press
  617. <ctrl-break>. The disc is now formatted, but the free space map and
  618. catalogue have not been installed. This can be done with:
  619. 2.2
  620. DIM buffer% 3072
  621. 2.2
  622. SYSöADFS_DiscOpò,,1,0,buffer%,3072
  623. 2.2
  624. SYSöADFS_DiscOpò,,2,1,buffer%,3072
  625. 2.2
  626. You try this entirely at your own risk! Ed.
  627. 2.2
  628. Å   Problems with ON ERROR LOCAL Ö John Smith says he thinks heæs
  629. discovered a problem when using LOCAL ERROR with ON ERROR LOCAL. It
  630. occurs because ON ERROR LOCAL stores the exact position in the program
  631. structure. The User Guide mentions this with respect to REPEAT...UNTIL
  632. and WHILE...ENDWHILE loops, but it also seems to apply to IF..THEN...
  633. ELSE...ENDIF constructs. Once the error handler has done its job,
  634. processing must continue at the same part in the structure in which the
  635. original error happened. For example,
  636. 2.2
  637. 1000 DEF PROCtest(arg)
  638. 2.2
  639. 1010 LOCAL ERROR
  640. 2.2
  641. 1020 ON ERROR LOCAL PRINT öCanæt
  642. 2.2
  643.  divide by zero Ö try againö
  644. 2.2
  645. 1030 IF arg < 100 THEN
  646. 2.2
  647. 1040 INPUT value
  648. 2.2
  649. 1050 PRINT arg/value
  650. 2.2
  651. 1060 ENDIF
  652. 2.2
  653. 1070 ENDPROC
  654. 2.2
  655. If a value of zero is input, line 1050 will error. As written, the above
  656. code will then print a warning message and effectively execute a öGOTO
  657. 1030ò. At this point, the error handler stack is corrupted. The program
  658. may appear to work without problem, but if any future error should
  659. occur, the program may produce a run-time error something like öAttempt
  660. to exit from badly nested error handlerò or something similar. Occasion
  661. ally, I have even managed to produce the dreaded öAddress Exception
  662. errorò!
  663. 2.2
  664. The solution to this problem is quite simple Ö place the code that could
  665. error together with the relevant error handler in a separate PROCedure.
  666. I have not (yet) had any problems doing this:
  667. 2.2
  668. 1000 DEF PROCtest(arg)
  669. 2.2
  670. 1030 IF arg < 100 THEN
  671. 2.2
  672. 1050 PROCprint(arg)
  673. 2.2
  674. 1060 ENDIF
  675. 2.2
  676. 1070 ENDPROC
  677. 2.2
  678. 2000 DEF PROCprint(arg)
  679. 2.2
  680. 2010 LOCAL ERROR
  681. 2.2
  682. 2020 ON ERROR LOCAL PRINT öCanæt
  683. 2.2
  684.  divide by zero Ö try againö
  685. 2.2
  686. 2040 INPUT value
  687. 2.2
  688. 2050 PRINT arg/value
  689. 2.2
  690. 2060 ENDPROC
  691. 2.2
  692. First Word Plus Hints & Tips
  693. 2.2
  694. Here are a few of the many contributions weæve been sent about First
  695. Word Plus. Weæve got a file of about ten other contributions, so we do
  696. need someone who knows FWP, has a reasonable skill at writing and has a
  697. bit of spare time to field the enquiries, assimilate the hints and tips
  698. and regurgitate something to us each month.
  699. 2.2
  700. Å   First Word Plus startup Ö If you are getting fed up of starting
  701. First Word Plus and finding yourself in lower case, you could *Configure
  702. Nocaps, but that is a nuisance if you do programming and want to start
  703. up in Shiftcaps. The solution is to extend the boot file, adding
  704. *FX202,48.
  705. 2.2
  706. Å   LQ850 with sheetfeeder Ö If youære having problems with this
  707. combination, Acorn say that you should edit the printer driver so that
  708. entry 4 (vertical tab) is commented out by pre-fixing it with a ö*ò.
  709. Also, note that if your printer is doing auto-linefeeds, you should also
  710. edit option 1 to remove the line feed value (A) from the line to leave
  711. just the carriage return (D).
  712. 2.2
  713. Å   Star LC10 Ö (ref. the Help enquiry we had last month) David Francis
  714. says he uses the Epson FX driver successfully with this printer. He has
  715. the dip switches set as follows: 1-1 to 1-8 and 2-1 and 2-4 are all ON
  716. and 2-2 and 2-3 are OFF. The Archimedes is configured to IGNORE 0. With
  717. this setting, the printer prints out the test, including the graphics
  718. part. As set, it also prints under <ctrl-B> as well as with Artisan.
  719. Heæs also tried to change the hex file to get it to work with quadruple
  720. size, but hasnæt succeeded yet.
  721. 2.2
  722. Å   Printer drivers Ö In designing my own printer drivers for both the
  723. Citizen 120D and Star LC-10 printers, I have not come across the problem
  724. noted, but mine were modified from the Epson LX printer driver. There
  725. was an item on the Letters section (page 128) of Octoberæs issue of the
  726. Micro User referring to an apparently similar problem, which the writer
  727. cured by öcommenting outò line &20 of the printer driver. I must admit
  728. that I cannot understand why this should have any effect, but in case it
  729. benefits other Archive readers, I detail below those elements of the
  730. printer drivers I have set up relating to form or line feeds (refer also
  731. to page 227 of the First Word Plus manual):
  732. 2.2
  733. 1D, A Ö Linefeed (N.B. carriage return & linefeed)
  734. 2.2
  735. 1E, C Ö Formfeed (N.B. &C = 12 as mentioned in the article)
  736. 2.2
  737. 1F, 12 Ö Horizontal initialisation (N.B. appears to cancel condensed)
  738. 2.2
  739. 20, 1B, 52, 0 Ö Vertical initialisation (N.B. appears to select USA
  740. characters)
  741. 2.2
  742. A further possible cause of problems may be to do with the printeræs dip
  743. switches, on page 218 of the First Word Plus manual it does state that:
  744. 2.2
  745. Skip over perforation must be DISABLED and Auto linefeed must be
  746. DISABLED
  747. 2.2
  748. Å   Printer Drivers with extended characters Ö Ted Peat has sent in
  749. various bits for FWP which weæve put on the program disc.
  750. 2.2
  751. The printer drivers were written to permit both the Panasonic KXP-1081
  752. and the Diablo-ecs printer to access the same set of extended characters
  753. (those with codes from 160 to 255). The character set of the Archimedes
  754. is also modified to suit.
  755. 2.2
  756. The Diablo-ecs printers use a daisy wheel with a double row of charac
  757. ters, giving 192 in all. The usual ASCII set is supplemented by
  758. characters with codes >128. The description given here applies to the
  759. Éscientificæ wheel containing Greek and mathematical symbols. The KXP-
  760. 1081 can be switched to emulate the IBM Graphics set, which also
  761. includes some Greek letters and some (but not all) useful mathematical
  762. symbols, again with codes >128. There are also some table-drawing
  763. symbols which are replicated several times over, and accented characters
  764. not needed for this application. Since up to 40 user-defined characters
  765. are possible, these redundant characters can be replaced. This then
  766. offers the opportunity to produce matched sets of symbols for the two
  767. printers and the Archimedes.
  768. 2.2
  769. I decided to include the complete Greek alphabet, which involves
  770. duplication of some upper case letters, and (for the KXP-1081 only), one
  771. set of table-drawing symbols. Two other symbols were added: an overline
  772. and backspace. Backspace is entered into the text as a large leftward
  773. pointing arrow-head (stored as character 161), but interpreted by the
  774. printer as a true backspace. One consequence of this, of course, is that
  775. text loses its WYSIWYG property. The advantage, however, is that both
  776. superscripts and subscripts can be attached to the same symbol, and the
  777. overline can be used to write a bar above a character. Since these
  778. peculiar needs are only likely within equations, the loss of on-screen
  779. text formatting is a minor irritation. Another complication was that the
  780. Diablo lost its left margin alignment after a backspace, when printing
  781. in the reverse direction. This option had to be switched off, slowing
  782. the printer down.
  783. 2.2
  784. There were two options for changing the Archi-medes character set. One
  785. was to change the Archi-medes font, to match that desired as far as
  786. possible, and then to redefine characters for the few changes needed.
  787. The most useful character set is that described as BFONT on p. 458 of
  788. the User Guide. To access this you need to *Configure Country Master.
  789. The second way: which is the one I adopted was to redefine all charac
  790. ters from 160 to 255. To do this I added a section to the 1st Word +
  791. loading program (Library.1stWord+ on the program disc).
  792. 2.2
  793. Once this was done, mapping the new character set to the Diabloæs set
  794. was easy: merely rewrite one of the provided Diablo Printer Drivers (in
  795. the hex dir-ectory) by changing the character translation table which
  796. forms the last part of the printer driver text.
  797. 2.2
  798. The KXP-1081 offered more complications. Firstly, it is necessary to
  799. download the redefined character set before loading 1stWordPlus. Another
  800. addition to the loader program, together with a user prompt, took care
  801. of this. Secondly, switching this printer to its IBM Graphics mode
  802. caused comp-lications with graphics printing: all the linefeeds became
  803. doubled! The printer driver codes were therefore expanded so that for
  804. each character the printer was switched into IBM Graphics set, the
  805. character printed, and then switched back to the Epson mode. This sends
  806. seven characters to the printer for every one actually printed. Since
  807. these are only occasional characters, the loss of efficiency is not
  808. important
  809. 2.2
  810. Å   Printer Driver Generator Ö John Smith has sent in, not another
  811. printer driver, but a printer driver generator program. Heæs given it to
  812. be used as public domain software, so we have put it on Shareware disc
  813. number 2. For best results, copy the PDG program onto a copy of the 1st
  814. Word Plus Utilities disk before running it.
  815. 2.2
  816. Å   Tabs and underlining Ö This one is for dum-dums like me, writes
  817. David Crofts, who learn word-processing at the finger tip.
  818. 2.2
  819. Underlining Ö I spent many happy, but frustrating, hours fiddling with
  820. forms to try to sort out under-lining in intervening spaces, till I
  821. discovered that the hated TAB holds the key! (I expect this is obvious
  822. for lots of people, but hold on to the yawns.) I was used to VIEW where
  823. the TAB key worked öprop-erlyò. (It inserted a TAB character, whatever
  824. that was, but it meant that a change in ruler meant a change in layout.)
  825. In FWP the Indent key does this job, except that it puts in a special
  826. stretch space which is fixed in spite of further ruler alterations.
  827. Because of this I had ignored TAB as useless.
  828. 2.2
  829. TAB inserts a set of normal spaces which have to be deleted individually
  830. Ö a nuisance if you are experi-menting with documents. But Ö you can
  831. underline TAB spaces, whereas you canæt underline Indents! And therein
  832. lies the hint!
  833. 2.2
  834. By all means use indents to facilitate experi-mentation but, in the end,
  835. TABs are preferable, where you wish subsequently to underline. If you
  836. have used Indents, then all is not lost, though fiddle is the name of
  837. the game. Turn off Insert, and turn on Underline (f2), then fill in the
  838. spaces with Fixed Space (f10). Then use the mouse or keyboard to
  839. underline the words.
  840. 2.2
  841. e.g. Say you have a form, the head of which is:
  842. 2.2
  843. Name   Address   Telephone
  844. 2.2
  845. the above is the result using Indent, but using TAB you will achieve:
  846. 2.2
  847. Name╩╩╩╩╩╩Address╩╩╩╩╩╩Telephone╩╩╩╩╩
  848. 2.2
  849. Placing a TAB at the appropriate point near the end of the ruler allows
  850. the line to be printed to the same length on each line.
  851. 2.2
  852. Å   InterWord to FWP via ArcWriter Ö This is how Ian Barnes achieves the
  853. transfer:
  854. 2.2
  855.    1.   Transfer file from IW to AW_DOC directory
  856. 2.2
  857.    2.   Run ArcWriter
  858. 2.2
  859.    3.   Press <select> for filing menu
  860. 2.2
  861.    4.   Highlight file x
  862. 2.2
  863.    5.   Press <menu>, select import, flowing, return
  864. 2.2
  865.    6.   Press <select> for filing menu
  866. 2.2
  867.    7.   Press <menu> and select export plus new name
  868. 2.2
  869.    8.   Transfer file to 1WP.doc directory
  870. 2.2
  871.    9.   Run 1WP and open file
  872. 2.2
  873.    10.   Select WPmode from edit menu
  874. 2.2
  875.    11.   Tidy up text by deleting control characters, changing any odd
  876. letters and inserting returns at line ends to leave a presentable result
  877. 2.2
  878. Å   Files from ArcWriter Ö The article by Brian Carroll in Julyæs issue
  879. of Archive under the heading of öFirst Word Plus Notesò (pages 21-23)
  880. was very useful together with the program ConvertWP (also on that
  881. monthæs Magazine disc). Although designed to convert Wordwise Plus
  882. files, the program works quite well with ArcWriter as well. Briefly the
  883. procedure to convert ArcWriter files into First Word Plus is as follows:
  884. 2.2
  885. 1. From the ÉFilingæ menu in ArcWriter select the ÉExportæ option to
  886. save the file (e.g. under the name ötestARCò) and then exit from
  887. ArcWriter.
  888. 2.2
  889. 2. Load the ConvertWP program and enter the appropriate Source
  890. (ötestARCò) and Destination (e.g. ötest1WPò) filenames.
  891. 2.2
  892. 3. Load First Word Plus and then the converted file (ötest1WPò).
  893. 2.2
  894. 4. Select ÉWPmode onæ from the Edit menu.
  895. 2.2
  896. 5. Reformat the whole text by using the Style menu to ÉReformatæ the
  897. ÉWhole documentæ.
  898. 2.2
  899. Odd words may sometimes get missed out of the converted text, possibly
  900. due to the fact that this data was preceded by ötabsò in ArcWriter.
  901. 2.2
  902.