home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / LA / LA026.ZIP / LN2.SIM < prev    next >
Text File  |  1990-10-14  |  3KB  |  154 lines

  1. te1 qc
  2. !
  3. !
  4. !
  5. ! ┌──────────────────────┐
  6. ! │ WELCOME TO LESSON 2  │
  7. ! └──────────────────────┘
  8. !
  9. !
  10. !
  11. qp
  12. ! This lesson let you learn how to
  13. ! enter a 6502's  mini assembly program
  14. ! which will print from 1 to 9 on the terminal.
  15. !
  16. ! First you need to activate the 6502 simulator.
  17. !
  18. fc 6502
  19. !
  20. ! The next command sets the input address of
  21. ! the mini assembly syntax to start at 1000.
  22. !
  23. pa1000
  24. !
  25. ! Those command lines which follow and begin
  26. ! with 'a' will be assembled into machine codes.
  27. !
  28. qp
  29. !
  30. a LDX #$31
  31. !
  32. ! Only hexadecimal values (#$) can be
  33. ! accepted by this 1.1 version.
  34. a TXA
  35. a INX
  36. a CSO A
  37. !
  38. ! "CSO A" is a non-6502 assembly instruction
  39. ! which was built in for your convenience to
  40. ! display the content of the accumulator on your terminal.
  41. a CPX #$3A
  42. a BNE $1002
  43. a STP
  44. ! "STP" is another non-6502 assembly instruction
  45. ! which was built in for your convenience.
  46. qp
  47. !
  48. ! The next command will save this 6502's
  49. ! assembly program into file 6502.ump
  50. ! in UMPS format.
  51. !
  52. fw u 6502 1000 30
  53. !
  54. ! You can also save your file
  55. ! in b (binary), i (Intele),
  56. ! or m (Mostek) instead of u (UMPS).
  57. !
  58. qp
  59. !
  60. ! The next command sets sSA to start at $1000
  61. ! to begin the execution of the program.
  62. !
  63. ps1000
  64. !
  65. ! The next command executes the first instruction step.
  66. !
  67. s
  68. !
  69. ! The first line shows the next instruction and
  70. ! its machine code after the execution of one step.
  71. ! The second and the third lines show the
  72. ! content of all the registers and flags.
  73. qp
  74. !
  75. ! The next command will execute
  76. ! the rest of the program.
  77. ! The result "123456789" will be printed out.
  78. !
  79. sg
  80. !
  81. qp
  82. !
  83. ! If you want to print out 5 to 8 instead of 1 to 9,
  84. ! the contents of location $1001 and $1006 need
  85. ! to be $35 and $39, respectively.
  86. ! The following commands will make the changes.
  87. !
  88. ! Enter hexadecimal number 35 for location 0x1001.
  89. !
  90. pi1001
  91. ix 35
  92. !
  93. ! Then enter the decimal number 57 (0x39)
  94. ! for location 0x1006.
  95. !
  96. pi1006
  97. id 57
  98. !
  99. qp
  100. !
  101. ! To see the whole program after this modification
  102. ! assign dSA at 0x1000 to start the disassembler
  103. ! and display 0x7 instrucion codes.
  104. !
  105. pd1000
  106. !
  107. d7
  108. !
  109. qp
  110. !
  111. !
  112. ! What is all of the SAs now?
  113. !
  114. pp
  115. !
  116. ! To execute the newly changed program the
  117. ! sSA needs to be changed from 100A to 1000.
  118. !
  119. ps1000
  120. !
  121. ! The result "5678" will be printed out.
  122. !
  123. sg
  124. !
  125. qp
  126. !
  127. ! Use the next command to load the original
  128. ! file back into the default location $1000.
  129. !
  130. fr u 6502
  131. !
  132. ! Do you want to see the changes?
  133. ! What commands do you need?
  134. !
  135. qp
  136. !
  137. ! There are files named 6800.UMP, 8085.UMP and z80.UMP
  138. ! for users of MPU's other than the 6502 to practice UMPS.
  139. ! These files with the extension ".UMP" provides
  140. ! the same function as 6502.UMP file.
  141. !
  142. ! Files 6502.BIN, 6502.INT and 6502.MOS
  143. ! are included for your reference.
  144. ! These files and file 6502.UMP have the same
  145. ! original data but are stored in different data formats.
  146. !
  147. ! When you use "fr" command to read a ".BIN" file
  148. ! you always need to specify the destination.
  149. !
  150. ! Use the command "fb ln3"
  151. ! to learn the UMPS lesson 3.
  152. ! Use the command "qq" to exit from UMPS.
  153. !
  154.