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

  1. te1
  2. qc
  3. !
  4. !
  5. !
  6. !
  7. !
  8. ! ┌──────────────────────┐
  9. ! │ WELCOME TO LESSON 3  │
  10. ! └──────────────────────┘
  11. !
  12. !
  13. !
  14. qp
  15. !
  16. ! This lesson let you use the batch file
  17. ! 8085bd.sim to practice the UMPS's break function.
  18. !
  19. ! The subroutine in 8085bd.sim can change your
  20. ! binary data starting from 0700H into binary
  21. ! coded decimal (BCD) data starting from 0708H.
  22. !
  23. qp
  24. !
  25. fc 8085
  26. pa1000
  27. ay
  28. xra   a
  29. mov   b,e
  30. lxi   h ,0708h
  31. mov   m,a
  32. inx   h
  33. dcr   b
  34. jnz   1005h
  35. mov   a,d
  36. add   a
  37. add   a
  38. add   a
  39. mov   c,a
  40. mvi   l,00h
  41. mov   b,d
  42. mov   a,m
  43. ral
  44. mov   m,a
  45. inx   h
  46. dcr   b
  47. jnz   1013h
  48. mvi   l,08h
  49. mov   b,e
  50. mov   a,m
  51. adc   a
  52. daa
  53. mov   m,a
  54. inx   h
  55. dcr   b
  56. jnz   101eh
  57. dcr   c
  58. jnz   1010h
  59. stp
  60. end
  61. !
  62. !
  63. ! The 8085bd.sim file is loaded into
  64. ! locations 1000H to 102BH.
  65. !
  66. qp
  67. !
  68. ! At the beginning the number of bytes
  69. ! for the binary data and BCD data need to
  70. ! be loaded into D and E registers respectively.
  71. !
  72. ! Set registers D=2, E=3 by the "rx" command.
  73. !
  74. rxd,2
  75. rxe,3
  76. !
  77. ! The next command "rp" lists the values
  78. ! of all the registers and flags.
  79. !
  80. rp
  81. !
  82. qp
  83. !
  84. ! Store the binary data 1100 1101 (CD) into 0700H.
  85. !
  86. pi0700
  87. ix cd
  88. pm0700
  89. m8
  90. !
  91. qp
  92. !
  93. ! There is a loop beginning at 1010H
  94. ! If C register (detected at 1028H) is
  95. ! not set to zero there will be a jump to 1010H.
  96. !
  97. ! Let's set a break point at 1028H.
  98. !
  99. bp1028
  100. bl
  101. !
  102. qp
  103. ! Let's execute the first loop and look at the result.
  104. !
  105. ps1000
  106. !
  107. sg
  108. !
  109. m8
  110. !
  111. ! After the first loop C=0F.
  112. ! At 0700H "CD" (1100 1101) rotated left
  113. ! through carry and became "9A" (1001 1010)
  114. ! At 0701H "00" rotated left through carry and became "01".
  115. qp
  116. !
  117. sg
  118. !
  119. m8
  120. !
  121. ! After the second loop C=0E.
  122. ! At 0700H "9A" rotated left through carry and became "34".
  123. ! At 0701H "01" rotated left through carry and became "03".
  124. !
  125. qp
  126. !
  127. ! You already have seen what each loop does.
  128. ! To see the result from the rest of the loops
  129. ! just erase the break point at 1028H.
  130. !
  131. be1028
  132. bl
  133. !
  134. sg
  135. !
  136. m8
  137. !
  138. ! The binary data "CD" stored at 0700H has been changed
  139. ! to BCD "0205" and stored into 0709H and 0708H.
  140. !
  141. qp
  142. !
  143. !
  144. ! To see what the BCD value is for the biggest
  145. ! four bytes of binary data "FF FF FF FF",
  146. ! enter the following:
  147. !
  148. rxd,4
  149. rxe,5
  150. !
  151. pi0700
  152. ix FF FF FF FF
  153. m8
  154. !
  155. qp
  156. !
  157. ps1000
  158. !
  159. sg
  160. !
  161. m8
  162. !
  163. ! The binary data "FF FF FF FF" before the
  164. ! execution from 0703H to 0700H has been changed
  165. ! to BCD data "4,294,967,295" from 070CH to 0708H.
  166. !
  167. qp
  168. !
  169. ! The subroutines in files 6502bd.sim,
  170. ! 6800bd.sim and z80bd.sim have the same
  171. ! function as the subroutine in 8085bd.sim.
  172. !
  173. ! Initially, the number of bytes of the
  174. ! binary data and BCD data need to be loaded
  175. ! into the D and E register for the z80
  176. ! whereas for the 6502 and 6800 this information
  177. ! must be stored into locations $0710 and $0711.
  178. !
  179. !
  180. qp
  181. !
  182. ! Use the command "fb ln4.sim"
  183. ! to learn the UMPS lesson 4.
  184. ! Use the command "qq" to exit from UMPS.
  185. !
  186.