home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 242 / 242.d81 / t.bassem < prev    next >
Text File  |  2022-08-26  |  4KB  |  161 lines

  1. u
  2.              B A S S E M
  3.          by Fernando Sanchez
  4.         from Compute! Gazette
  5.  
  6.  
  7.     This is the assembler that I use
  8. constantly. Once run, you are in an
  9. extended BASIC which includes
  10. everything you need to write ML!
  11.  
  12.     Write BASSEM code just like you
  13. would a BASIC program, with line
  14. numbers on every line. You can even
  15. use colons to separate multiple
  16. instructions on one line.
  17.  
  18.     To simplify things, I have a
  19. program on this disk called "SHELL.BC"
  20. which has all the set-up requirements
  21. pre-coded. After booting BASSEM,
  22.  
  23.           load"shell.bc",dv
  24.  
  25. List line 60008 and change it to:
  26.  
  27.           60008 n$="myprog"
  28.  
  29. where "myprog" is your program name.
  30. Do not include any extension. BASSEM
  31. SHELL will do this for you
  32. automatically. A file with *.BC is
  33. Bassem Code. *.ML is the Machine
  34. Language object code generated by
  35. BASSEM. To save your new BC code, type
  36. and <RETURN> GOTO60000
  37.  
  38.     You can write your code anywhere
  39. between lines 50 and 49997. I use
  40. 50-99 for assignments:
  41.  
  42.              50 _irq=$314
  43.  
  44.     The <BACK ARROW> indicates a
  45. label. Labels must begin with a
  46. letter, but can be any number of
  47. characters, numbers, or periods. NO
  48. spaces or punctuation!
  49.  
  50.     The $ indicates a hex number.
  51. Decimal has no prefix (and works just
  52. fine). For binary values, use %, as
  53. in:
  54.  
  55.           51 _bit7=%10000000
  56.  
  57.     I use lines 100-199 for the Jump
  58. Table.
  59.  
  60.             100 jmp_setup
  61.  
  62.     The main code usually begins at
  63. line 1000. All standard 6502 assembly
  64. commands are allowed. However, BASSEM
  65. does not have:
  66.  
  67.             lda#<_address
  68.             ldx#>_address
  69.  
  70. Instead, SHELL includes two FNs that
  71. work perfectly:
  72.  
  73.           lda#fnl(_address)
  74.           ldx#fnh(_address)
  75.  
  76.     While BASIC commands work during
  77. the assembly, they are NOT assembled
  78. into the code. You can use FOR-NEXT
  79. loops to generate stretches of
  80. repetitive code:
  81.  
  82.     2000  _screencopy
  83.     2002  ldy#250
  84.     2004  _scloop
  85.     2005  dey
  86.     2006  :forx=0to3
  87.     2008  :lda_from+x*250,y
  88.     2010  :sta1024+x*250,y
  89.     2012  :next
  90.     2014  cpy#0:bne_scloop
  91.     2016  rts
  92.  
  93. This will generate:
  94.  
  95.     ldy#249
  96. _scloop
  97.     dey
  98.     lda_from,y
  99.     sta1024,y
  100.     lda_from+250,y
  101.     sta1274,y
  102.     lda_from+500,y
  103.     sta1524,y
  104.     lda_from+750,y
  105.     sta1774,y
  106.     cpy#0:bne_scloop
  107.     rts
  108.  
  109.  
  110.     Assembly of your code is easy.
  111. First, list line 1 and assign the
  112. memory where you want to put the
  113. program. You can have different
  114. locations for immediate memory
  115. assembly and for assembly to disk. For
  116. example, you might be writing
  117. something for $1000, but BASSEM is in
  118. the way. So set the Memory value to
  119. 49152 and the Disk value to $1000.
  120.  
  121.     To assemble, just run the program.
  122. You will need to press <1> for Memory
  123. or <2> for Disk. It is best to check
  124. the code in memory first, because you
  125. will get errors! Simply fix the
  126. errors, do a GOTO60000 (scratch and
  127. save), and run again.
  128.  
  129.     The end of the assembled area is
  130. 49997. Line 49998 is PASS2, which
  131. markes the end of assembly. 49999 is
  132. END.
  133.  
  134.     Therefore, you can use lines
  135. 50000-59999 for text runs of your
  136. code. All labels will work in BASSEM
  137. Basic, so you can have
  138.  
  139.             50000sys_setup
  140.  
  141. NOTE: Sometimes BASSEM gets confused
  142. and can't find the labels. I hope you
  143. saved your work. Reset your computer,
  144. reboot BASSEM, load your BC code, and
  145. do it again.
  146.  
  147.     Once you have your code working
  148. perfectly, RUN the assembly again,
  149. this time pressing <2>. A file with a
  150. *.ML extension will be written onto
  151. the disk. If you already have
  152. "myprog.ml", it will be scratched and
  153. the new version will be saved.
  154.  
  155.     After doing an assembly to Disk,
  156. BASSEM gets flakey. Reset and reboot
  157. and all is well.
  158.  
  159.  DMM
  160.  
  161.  
  162.