home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / alt / hackers / 1351 < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.3 KB  |  60 lines

  1. Newsgroups: alt.hackers
  2. Path: sparky!uunet!psgrain!hippo!nuustak!csir.co.za!duck
  3. From: duck@nuustak.csir.co.za (Paul Ducklin)
  4. Subject: Re: YAFP: TRS-80 Super Graphics
  5. Organization: Infotek, CSIR
  6. Date: Wed, 02 Sep 92 15:24:27 GMT
  7. Approved: madmax@fruit.bat.net
  8. Message-ID: <1992Sep02.152427.55@nuustak.csir.co.za>
  9. References: <1630242@zl2tnm.gen.nz>
  10. Lines: 48
  11.  
  12. Self-modifying code was very useful in most micro-Basics for
  13. things like dynamically sized arrays, where accessing a "new"
  14. array simply created a default-sized (usually 10 element)
  15. array without the need for a DIM statement.
  16.  
  17. I had an assembler I wrote once for the Oric ATMOS [..anyone
  18. other than me ever *seen* one of these -- I even got grilled
  19. at customs in Johannesburg for trying to import it {it was 80 quid
  20. in London in '85} as a gift, but the customs official turned
  21. out to be a Spectrum fan, which took all the "heat" off..]
  22. which utilised this technique: insert a line such as
  23.  
  24.  100 AA(I MOD 10) = whatever
  25.       ^
  26.       | 
  27. Then find out where the second 'A' sat in source mem, and adjust
  28. it by poking in 65+I/10 to produce AA, AB, AC, AD etc. according
  29. to the 10-element array you needed to access. Each of AA, AB, AC
  30. etc. was then only created when first accessed -- a heapish type
  31. thing.
  32.  
  33. I also found the 
  34.    10 REM FN = XXXXXXXXXXXXXXXXXXXXXXXXXXX 
  35.    20 RETURN
  36. to be useful for implementing an infix expression evaluator within the
  37. assembler -- just POKE the expression to be evaluated into the 
  38. XXXX region and GOSUB 10! Lo - Basic does the work, and the error 
  39. reporting. Of course, you needed to convert '+', '-', '/' etc. from
  40. ASCII to TokenValue first...
  41.  
  42. This was not for want of memory [there was 48KB!!], but to reduce
  43. code size due to a zany cassette interface. You could do 2400bps
  44. with almost no reliability at all, or 300bps will almost no unreliability.
  45. Or you could save, say, 4 times at 2400bps and cross your fingers.
  46.  
  47. Hey -- the ATMOS was a true portable. Transformer in the plug; whole 
  48. base unit smaller than a Poqet; plug into your nearest TV set. The
  49. display was Prestel only! Weird.
  50.  
  51. Paul Ducklin
  52. CSIR - Pretoria - ZA
  53. -- 
  54.  
  55. --<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--<>--
  56. Paul Ducklin                                           duck@nuustak.csir.co.za
  57.  
  58.     CSIR Computer Virus Research Lab * Box 395 * Pretoria * 0001 S Africa
  59.  
  60.