home *** CD-ROM | disk | FTP | other *** search
/ Commodore 64 Scene Diskmags Assortment / Commodore_CEE_Vol._1_Issue_06_1995_Jack_Vander_White_Disk_2_of_3_Side_A.d64 / turboass.doc < prev   
Text File  |  2023-02-26  |  19KB  |  400 lines

  1. TurboAssembler - The full documentation!
  2.  
  3. After the release of XMem Ass we've had a lot of queries about the features of it. I've found that A LOT of the users, and even the kewles ones, know very few of the vast range of features the original TurboAssembler can bring. Therefor I decided to type those docs in for you! First the docs for the normal 5.2 version:
  4.  
  5. Most functions are activated through the * (left arrow) followed by an other key. (Note that some of them are CAPITAL letters, meaning you have to press shift along with it!). All commands below need to be preceeded by g
  6.  
  7. 1       Back to basic 
  8. 2       Separator line 
  9. 3       Assemble 
  10. 4       Print (? - print, name - to file, ' - To Screen) 
  11. 5       Produce object file (ass to disk) Be careful: The * doesn't work a second time here!!!! 
  12. 6       Input part of the memory as data! 
  13. 7       Set tab (Cursor pos after Return) 
  14. 8       Position of mnemo column. 
  15. q       Cursor to the left edge 
  16. w       Write as SEQ file (Save) 
  17. e       Enter a SEQ file (Load) 
  18. r       Replace: ... By: ... Finds the first occurance. 
  19. t       Executes first replace (See "r") 
  20. y       Executes ALL replaces. (See "r") 
  21. u       List labels (? - To Printer, Name to disk, ' to screen) 
  22. i       Initialize memory (Zero fill unused) 
  23. o       Change colours 
  24. p       Protect file (Enter an EOR for the file - Stupid!!! Some versions had $33 as default. Beware!!) 
  25. @       Diskstatus 
  26. *       Directory 
  27. +       Additionroutine 
  28. -       Subtractionroutine 
  29. *       Put row in the line buffer 
  30. v/#     Insert buffer (See *) 
  31. a       Enter controlcodes (Abort with *) 
  32. l       Load file in PRG format 
  33. s       Save file in PRG format 
  34. d       Diskcommand 
  35. f       Find: ... (See "H") 
  36. h       Hunt next (Define with "F") 
  37. g       Goto mark (See "M") 
  38. j       Hexdump specified memory area 
  39. k       Redefine F3-F6 (followed by the key you wish to redefine). 
  40. :       List marks 
  41. c       Coldstart (Like "NEW" in basic) 
  42. v       Memory map (DON'T use with Action Replay as the LDA $DE00 hangs the  computer!!!) 
  43. b       Block command (A block must be defined with the "M" command first). You  can  from here copy, write to disk, kill or save out the section previously defined. 
  44. n       Go to specified line in the source 
  45. m       Set marks (0-9 for bookmarks, S - Start of block, E - End of block) 
  46. =       Join lines (Hard to explain! Try!) 
  47. Return  Insert a line (undo "=") 
  48. ;       Kill mark
  49.  
  50. L       Load data at address (return at question loads at the files default addr ess) 
  51. S       Save data at address 
  52. F       Fill memory (specify range) 
  53. K       Keyclick on/off (yuack!)
  54.  
  55. F1      F-key reset (undo "*"+"k" edits) 
  56. DEL     Delete line 
  57. /       Delete the data the rest of the line, after the cursorposition. (Very useful to delete crap from resource files!) 
  58. INST    Line insert ON/OFF
  59.  
  60.  
  61. To insert a "*" (left arrow), just doublepress the key!
  62.  
  63. F-Keys 
  64. F1      One screen up 
  65. F2      Go top 
  66. F7      One screen down 
  67. F8      Go bottom
  68.  
  69. The F3 - F6 are redefinable. If you find another "kewl version", it's almost always only new F- key definitions they've added. Normally, i.e. they are something like:
  70.  
  71. F3      .WORD/.TEXT/DIR  (Either of 'em) 
  72. F4      Assemble and start 
  73. F5      .BYTE 
  74. F6      Delete current row
  75.  
  76.  
  77. Without other previous keypresses:
  78.  
  79. Inst    Insertmode ON/OFF (ie insert or overstrike)
  80.  
  81.  
  82. Pseudo opcodes
  83.  
  84. .BYTE <parameterlist>
  85.  
  86. f.ex:
  87.  
  88. .BYTE "p", $ab,%100011001,49,&19
  89.  
  90. Enter data. Either within quotes (only one character), as hex ($E0) binary (%10001110), decimal (45) och octal (&34). Separate numbers with commas.
  91.  
  92. .WORD
  93.  
  94. f.ex:
  95.  
  96. .WORD label, $1000, label+$f8/2, *-9
  97.  
  98. Enter 16 bit/2 byte address in the normal 6502/6510 way, i.e. lowbyte, highbyte. Any label and expression is valid!
  99.  
  100. * = $XXXX
  101.  
  102. XXXX is here the start for your code. Can be used any number of time, but beware while assembling to disk ("*"+"5").
  103.  
  104. label   = myarse 
  105. borderco        = $d020 
  106. memptrlab       = *+3   ;Offset from prgcount 
  107. andtest = $213&127      ;Logical AND 
  108. ortest  = %1000:$03     ;Logical OR 
  109. lowtest = <irqptr       ;LowByte of sth. 
  110. hitest  = >irqptr       ;Guess ? 
  111. screencol       = bordercol + 1 ;Define label.
  112.  
  113. Calculations or absolute numbers work just as good.
  114.  
  115.  
  116. .TEXT "Some text"
  117.  
  118. Enter some text in asci format. Beware that there is no obvious way of entering pokecodes, but for this purpose I recomend my own method. Either AND #$3F or:
  119.  
  120. Enter your monitor. Type the text to the screen and transfer it into a safe place in the memory.  Enter TurboAss and insert the data with "*"+"6"
  121.  
  122. ;
  123.  
  124. A comment for information purposes. Enter any comment after the semicolon. Truely good for you when you want to understand the crappy, ununderstandable code you produced when you were lame (last week! :-) or when you were too smart for you to remember right now.
  125.  
  126. .OFFS XXXX
  127.  
  128. This is a toughie, that relocates the code. The value after the offs is a value added to the *= value. F.ex. *=$1000 followed by .OFFS $0800 makes the code land on $1800 and .OFFS $F800 makes it land on $0800. Inserting things like drivecode, is a joy thanx to this feature, even if it could have been done a bit easier to understand. The trick to make it work is this piece of code:
  129.  
  130. label1
  131.  
  132.         *=$0400 ;Start for f.ex. drive code
  133.  
  134.         .OFFS 0-(*-label1)
  135.  
  136. label2  LDA label2
  137.         RTS
  138.  
  139. This will result in the code landing at label1 in memory (right after the rest of your code!) and the code will be exactly as if assembled to $0400, so the result at "label2" will be LDA $0400.
  140.  
  141.  
  142. Versions:
  143.  
  144. The latest version we released is 5.2 . New in this one is just the possibility to interrupt the directory listing with run/stop. Also you can poke in the end of the code (near $CF00) thedevice you'd like to use. It took some time to dig out all the hardcoded #$8's in the code, but here you go. No memory left to add an input option (which is available in "X-Mem ass 3.3")
  145.  
  146.  
  147. The X Mem assembler:
  148.  
  149. Coding is an art which can be heavily disturbed by insufficient tools, which cannot do what you want them to. This was the feeling the FairLighters have felt many times, while pushing our utilities to their outer limits.
  150.  
  151. As the Assembler and the ML monitor are the utilities we use the most, we tried to improve them as much as possible. The  main problem is that having the assembler, the source, music, data, graphics and so on on the memory makes you realize that 64Kb isn't all that much.
  152.  
  153. To overcome these limits you can produce an assembler porting the code through a cable (As Bonzai and Chromance did/do), but this requires an additional machine. It can aslo be done on another machine like an Amiga or a PC. Never the less, we all hate cables and we all hate not having enough room on the desks, don't we?
  154.  
  155. The other way is to adapt the assembler into working with the 17XX expansion memories.  This is the way we have chosen. XMem Ass is a system which removes all limits you've felt before in your coding deeds. The XMem Asm 3.3 is so far THE asembler for the C64. XMem Ass features the same commands as the original TurboAssembler 5.2 (see above), but forther "*"+"p" (Protect). We've found this command not only unnecessary, but also truly stupid!!  Beware of early, unfixed,versions of the assembler. They might contain $33 as the EOR value. (Read more on the subject "eor protect" later on in this text!)
  156.  
  157. All memory commands are now directed to the expansionmemory, rather than the internal memory. So the fill, load, save, "*"+"6" datafetch and all the others work on the bank selected. The assembler now uses two banks in the expansion memory, called objectbank (for all the data and the code) and one called the source bank, containing the source, a monitor (optional), the main assembler and the 17XX communication routines.
  158.  
  159.  
  160. Some new commands are supported: ("*" and the following characters. Note that they are all shifted!)
  161.  
  162. M       Go to TronMon (17XX monitor) 
  163. P       Enter page for return routine. Default page in memory is $0800, but this
  164.         is now changable. 
  165. B       Select objectbank. Default is 1. 
  166. D       Select diskdevice (From 3.3)  
  167. H       Hunt for a specified label, NOT all the references to it.
  168.  
  169. Bankselect is for selecting which banks in the memory to use (default is recomended!).  Default is bank 0 as source bank and bank 1 as object! Banks from 0 to 7 are supported (512 KB memory). None of the FairLighters have any bigger one, so we found no need for further expansions. Anyone with a 2 MB one that needs support?
  170.  
  171. Page is the routine dumped into the object bank when you select "s" after assembling! When you start this roiutine, you will go back to the assembler! (The three bytes are NOP's, so it's OK to put it at $0800, even if the three first bytes get destroyed at a reset here. You only make it back 6 cycles faster by sys:ing 2051 ($0803)
  172.  
  173. More on TronMon later (special doc section for it!).
  174.  
  175.  
  176. XMem Operation
  177.  
  178. Since the computer cannot address the Expansion Memory as TRUE memory (thus, you can not LDA from it nor execute code in it) it is necessary to "flip" the source and object banks back and forth when switching between the assembler and the finished code. It works something like this :
  179.  
  180. *       When you start editing the source, the assembler, source, x-mem routines (and monitor ?) resides in the c64's conventional RAM. It also exists as "a backup" in xmem bank 0.
  181.  
  182. *       Upon performing any memory-using action such as loading, saving, filling and assembling, all access is redirected to the xmem, into the OBJECT bank (default is 1!).
  183.  
  184. *       When starting your assembled program, the assembler will copy the RAM to the SOURCE bank (0) and then copy the OBJECT bank (def.1) into the RAM, and then start the program. None of these actions will be visible to you, as virtually nothing has changed, except for the memory redirection. It is necessary though to understand what actually happens to be able to comprehend the following.
  185.  
  186. *       Along together with your Object Bank, a "return" routine has been transfered. To return to the assembler, you simply start this routine with a SYS, JMP command or whatever. The routine uses 1 page of memory and resides at the page specified by using the "*"+"P" (shift+p!!) command.
  187.  
  188. *       NMI is also automagically redirected to the "return" routine (Not on all versions!), so pressing RESTORE will also allow you to go back to the source bank. Once in the "return" routine, you will  be prompted to specify what to do with the current RAM bank.  The coded working here is the so called "return routine".
  189.  
  190. *       Pressing CR will send it back into the OBJECT bank, and everything will appear as usual.  You may want to save it in another location just to study the effects on the RAM after a crash or similar, without messing the original object bank up. In this case just select a spare bank!  This is one of the biggest advantages of using the XmemAss system. Both the source and object banks are safely protected inside the xmem. (Remember to assemble once so the source lands in bank 0). If something was to destroy the whole contents of your standard 64 K RAM, you would still be able to get it all back by copying it back from the xmem. If the RAM is so badly mutilated that even the return routine has gone bonkers, you may load it from disk. On some disks it's called "!", on some "xass(!)" and again on others "obj.transfer". It might be handy to have this one available on your work disks!
  191.  
  192. *       New features from X-Mem Ass 3.3 are the ability to select your workdevice, to something else than 8. It took Tron and me (Bacchus) some time to hack all the hardcoded 8's, so we know why it wasn't done before on any version!
  193.  
  194. *       Also the new main advantage: We had some trouble as Tron's first TurboAssembler was a 5.0 with the EOR code set to $33, and this wasn't found until MUCH later. Swapping sources got to be a pain in the arse, as we had removed the "*"+"p" option and therefore had to convert them by loading some old and normal version of the assembler.
  195.  
  196.         We got fed up with this! I coded a EOR hacker, a few weeks ago.  This program gave the correct EOR code  for the file, if it had the tab set to $09 (99% of them have!). From this idea Tron built in his implementation of the same idea, but he did a more advanced one.  (As usual, he wanted to brag ... =o) This new feature will AUTOMAGICALLY deprotect the source you load, and it will base it's guess of the EOR-code on the macro on F6 (99.9% have row delete here). You can see the EOR code used while loading! All saving will be done with a $00 EOR.
  197.  
  198. *       Also, the DIR routine is now also interruptible. Pressing R/S halts the output!
  199.  
  200.  
  201. TronMon 2.0
  202.  
  203. First of all:
  204.  
  205. TurboAssembler is a heavily MODIFIED version of the Omikron original program. TronMon is on the other hand FULLY coded by Tron of FLT, for use with the Xmem Ass package. It's mainly a normal monitor, inspired by the one in ActionReplay. Mind one thing first:
  206.  
  207. You may use either commas or space to separate the arguments for the different commands.
  208.  
  209. Eg :    s "pelle",8,0800,4000
  210.         s "pelle" 08 0800 4000
  211.         s "pelle" 8 800 4000
  212.         s "pelle",8 0800,4000
  213.  
  214. These four examples do EXACTLY the same thing. Note the possibility to MIX the spaces and commas, and also the option  to ommit the leading zero(s).
  215.  
  216. I have the complete list of command for the 1.1 but the 2.0 ones I was in suggesting but never got any real docs from Tron. These are command I hacked out myself. Don't expect this list to be complete in any way!
  217.  
  218. Commands:
  219.  
  220. O       Bankselect. All operations are made to the bank you are
  221.         currently in, unless differently stated! Banks from O0 to OEF
  222.         are supported. OFX means internal RAM with the X value in $01
  223.         at the operation.
  224.  
  225. A       Assemble. eg
  226.         A1000 SEI
  227.  
  228. D       Disassemble eg
  229.         D1000 (2000) (D1000- is not implemented yet)
  230.  
  231. M       MemoryPeek. As the D for the options!
  232.  
  233. I       Screencode interrogate. (Works as I* in AR).
  234.  
  235. IZ      Show all bytes but for the zeros. Very handy for scanning the
  236.         zerofilled memory for small pieces of data.
  237.  
  238.         IZ 1000 2000
  239.  
  240.         Mind that IZ 1000 and scrolling up and down is not a valid
  241.         option. 
  242.  
  243. L       Load eg
  244.  
  245.         L "FOOBAR" 08 (1000) (3000)
  246.  
  247.         The last option is for the load to brake at a certain point,
  248.         if you just want a part of the data.
  249.  
  250. S       Save (Remarkable, isn't it?  :-) Eg.
  251.  
  252.         S "FOOBAR" 08 1000 2000
  253.  
  254.         This command is notorious for sometimes missing the end and
  255.         this is not a bug Tron has fixed yet. However, you can press
  256.         RunStop to abort the saving, which will properly close the
  257.         file at the address is was while pressing.
  258.  
  259. H       Hunt eg.
  260.  
  261.         H 1000 2000 10 (20 30 40 50)
  262.  
  263.         No more than 8 bytes and no text yet!
  264.  
  265. T       Transfer ex. T 1000 3000 -4 6000
  266.  
  267.         This transfers in memory and also between banks. The number
  268.         after the - selects the destinationbank. Default is the
  269.         current. It now works to transfer both upwards and downwards
  270.         in the same bank. At last, Tron!!
  271.         :-)
  272.  
  273. F       Fill memory eg.
  274.  
  275.         F 1000 2000 00
  276.  
  277. C       Compare. Same syntax as T, which enables comparisons between
  278.         banks!
  279.  
  280. N       Number conversions! eg.
  281.  
  282.         N $FCE2
  283.  
  284.         BIN convert bug removed! Also, the monitor quits if you don't
  285.         send a parameter.  Ooops! ;-)
  286.  
  287. @       The alfa sign for DOS commands eg.
  288.         @ -  Read channel
  289.         @X - Switches to device X (100%)
  290.         @$ - Directory (Only $, also!) Dir now features pattern search
  291.         eg.@$o.* or $pelle*
  292.  
  293.         Since V2.0 we also have blockcommands available.
  294.  
  295.         @BR 12 01 C0
  296.         @BW 12 01 C0
  297.  
  298.         This is standard Action Replay syntax! Mind that if the
  299.         program finds a link to another sector, the command to read
  300.         this sector is generated for you!
  301.  
  302. G       For GO
  303.  
  304.         This command uses a routine, a dwarf of the assembler's
  305.         "return" routine, you might say. It resides in $0380-$0400
  306.        (easy to destroy..).  The BRK vector and NMI vectors are
  307.        automatically set to $0380 and also the adress is pushed onto
  308.        the stack for RTS. The routine provides no selective storing,
  309.        it will simply copy everything in RAM back into the bank that
  310.        you jumped to. Unfotunately still  rather buggy!
  311.  
  312. E       EOR an area with a specified value. No option to EOR with a
  313.         mask from another area is implemented.
  314.  
  315.         E 1000 2000 33
  316.  
  317. R       Shows the current resisters.
  318.  
  319. *       RAM/ROM mode. If you have selected internal RAM using the O
  320.         command, this will switch between F0 and F7... (I.e. $01 set
  321.         to either $30 and $37)
  322.  
  323. X       For Exit
  324.  
  325.         Detects if the Assembler is in the memory. If yes; go to the
  326.         assembler or else do a warmstart.
  327.  
  328. IN      Increases a range
  329.  
  330.         IN 1000 2000 08
  331.  
  332.         This command adds 08 to all bytes in the range. You expected a
  333.         DE command?  You won't get it! The reason is very simple:
  334.  
  335.         IN 1000 2000 F8
  336.  
  337.         This subtracts 08 from every byte in the range!
  338.  
  339. LS      Load Seq file.
  340.  
  341.         LS "name" 09 1000
  342.  
  343. SS      Save Seq file.
  344.  
  345.         SS "name" 08 1000 2000
  346.  
  347. LL      This is a VERY kewl command. List Labels! It checks the
  348.         labletable for the results of the most recent assembly.
  349.  
  350.         LL ir
  351.  
  352.         This lists all lables starting with the string supplied, and
  353.         also the value they represented during the last assembly. This
  354.        above MIGHT result in something like;
  355.  
  356.         IRQ =$EA31
  357.         IRQLO = $0314
  358.         IRQHI =$0315
  359.         IRQOWN = $1008
  360.         IRINA =$FCE2
  361.  
  362.         You could swap to the XAss system for this feature alone!
  363.  
  364. FM      Memdump from a file.
  365.  
  366.         FM tfilenamet ,08
  367.  
  368.  
  369. Known bugs
  370.  
  371. There is a problem when you assign a label to a zeropageadress in some cases. I'll fill in more here later. Sorry for the lack of information.
  372.  
  373. Final words
  374.  
  375. That was all for this time, dudes!
  376.  
  377. If you have suggestions for improvements of if you have found that these docs have been wrong or uncompleat in any way then do not hesitate to send me a letter
  378.  
  379. The current adress is:
  380.  
  381. Bacchus of FairLight 
  382. Pontus Berg 
  383. Sveavagen 88, 5tr 
  384. 113 59 Stockholm 
  385. SWEDEN
  386.  
  387. or call: SWE +46-(0)8-6125464
  388.  
  389. E-mail: Bacchus@FairLight.Com
  390.  
  391. These docs were fully typed in by Bacchus of FairLight in my very own texteditor, Eddie Delux. Converted to the PC, and printed out at work!
  392.  
  393. As you might notice a 2.0 version of TronMon is present. I'll update the docs as soon as I find the time! There are quite a few new commands, but mainly is can't be run without an X-mem, but the advantage is SPEED! You fill a bank in .5 secons, for example! I'll update soon! Also try the LL for List labels!
  394.  
  395. FairLight#1
  396.  
  397. -------------------------------------
  398.  
  399.  
  400.