home *** CD-ROM | disk | FTP | other *** search
/ Commodore 64 Scene Diskmags Assortment / DMBBS_Bi-Monthly_Magazine_5_1990-06-01_Sledge.d64 / 8.1 < prev    next >
Text File  |  2023-02-26  |  3KB  |  129 lines

  1.  
  2.  
  3.  
  4.              Wildy's Corner!
  5.  
  6.  
  7.    In the following issues I am going 
  8. to use this as a ML For Beginners 
  9. course. By the time you finish it, you 
  10. will have enough knowledge to do 
  11. almost anything you want in ML. 
  12. Including some rudimentary special 
  13. effects as used in software pirate's 
  14. demos.
  15.  
  16.     For this month we are going to go 
  17. over the most basic commands in ML, 
  18. and I will show you how to use these 
  19. to write your first ML routine.
  20.  
  21.     Although most people view ML as 
  22. the 'complex' language, it is really 
  23. much simpler than BASIC. It is just 
  24. that you need a number of simple 
  25. commands to equal one command from a 
  26. high-level language such as BASIC.
  27.  
  28.     First we will learn about the most 
  29. important register in ML-the 
  30. Accumulator. Different ML instructions 
  31. allow you to copy the accumulator to a 
  32. memory location and vice versa, modify 
  33. its contents, and other useful tasks. 
  34. This may not seem like much but this 
  35. is where 50% of a program is 
  36. accomplished. In addition, the 
  37. accumulator is the only register that 
  38. has math instructions.
  39.  
  40.     Now we will learn our first ML 
  41. instruction. LDA. You may have guessed 
  42. it stands for LoaD the Accumulator and 
  43. is arguably the most used of all 
  44. commands. 
  45.  
  46.     Putting a '#' after LDA tells the 
  47. computer that you want to LoaD the 
  48. Accumulator with the value after it.
  49.  
  50.     A '$' following the LDA simply 
  51. tells the computer that the number 
  52. following is in hexadecimal form. (For 
  53. more info on HEX see the preceding 
  54. file.)
  55.  
  56.     With this knowledge you should 
  57. know that:
  58.  
  59. LDA #$05 
  60.  
  61. tells the computer to LoaD the 
  62. Accumulator with $05. Make sense? 
  63. Good. This is very simple to grasp but 
  64. is required to perform many things.
  65.  
  66.     Our next command is STA. It stands 
  67. for STore the Accumulator. This 
  68. command takes the value in the 
  69. accumulator and transfers it to to any 
  70. memory location you wish. 
  71.  
  72.     Before we can write our first 
  73. routine we need to know one more 
  74. command. BRK. It is the BReaK command 
  75. and is needed because in ML, if there 
  76. is no BRK at the end-it will just lock 
  77. up.
  78.  
  79.     Now we can write our first 
  80. routine. It is very simple and changes 
  81. the screen color to Cyan.
  82.  
  83.     To type it in a ML monitor you 
  84. need to follow this format.
  85.  
  86. .A 1400 LDA #$03
  87.  
  88.     The .A tells it that this is an 
  89. accumulator instruction. Afterwords, 
  90. the monitor will automatically number 
  91. and place the correct beginning on the 
  92. lines.
  93.  
  94. .A 1402 STA $D020
  95.  
  96.     $D020 is the equivelant to 53280 
  97. in decimal.
  98.  
  99. Last but not least...
  100.  
  101. .A 1404 BRK
  102.  
  103. Now press return until you are on a 
  104. clean line and type G 1400.
  105.  
  106. Bingo! If you did everything right it 
  107. will change your screen to Cyan.
  108.  
  109.  
  110.     Congratulations. You have now 
  111. created you first program. Play around 
  112. with those commands and see how much 
  113. else you can accomplish with that 
  114. little bit of info.
  115.  
  116.     Unfortunatly I was in a bind for 
  117. time this issue so it is semi small, 
  118. but next issue I will have a immense 
  119. column to help you further into the 
  120. world of ML.
  121.  
  122.     As always, if you have questions 
  123. or comments on this or any other 
  124. articles-contact me through Digital 
  125. Fantasia. 301+553+0001!
  126.  
  127. Later!
  128.  TWO!
  129.