home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / gen180.lbr / TEST.MZC / TEST.MAC
Encoding:
Text File  |  1987-12-04  |  2.8 KB  |  199 lines

  1. ;
  2. ;============================
  3. ;TEST
  4. ;============================
  5. ;written         15.04.87
  6. ;comments in english    19.11.87
  7.  
  8. ;purpose: show usage of new HD64180 commands
  9. ;
  10.     .Z80
  11. ;
  12. ;==================
  13. ;    SLEEP
  14. ;==================
  15. ;
  16. ;enter SLEEP (low power) operation mode
  17. ;format: SLP
  18. ;
  19. ;correct:
  20. ;
  21.     SLP
  22. ;
  23. ;wrong:
  24. ;
  25.     SLP    A
  26.     SLP    (HL)
  27.     SLP    DE
  28.     SLP    1
  29. EGON    EQU    1200
  30.     SLP    EGON
  31. ;
  32. ;==================
  33. ;    MULTIPLY
  34. ;==================
  35. ;
  36. ;8-bit multiply with 16-bit result
  37. ;format: MLT    ww    (ww = BC/DE/HL/SP)
  38. ;
  39. ;correct:
  40. ;
  41.     MLT    BC
  42.     MLT    DE
  43.     MLT    HL
  44.     MLT    SP
  45. ;
  46. ;wrong:
  47. ;
  48.     MLT
  49.     MLT    C
  50.     MLT    (HL)
  51.     MLT    12
  52.     MLT    EGON
  53. ;
  54. ;b u t:
  55. ;
  56.     MLT    AF
  57. ;
  58. ;is correct for M80, because AF and SP  a l w a y s  are
  59. ;the same for M80 !!!
  60. ;further examples:
  61. ;
  62.     INC    AF
  63.     DEC    AF
  64.     PUSH    SP
  65.     POP    SP
  66. ;
  67. ;imagine the effects of these commands, if they would be real!
  68. ;
  69. ;==================
  70. ;    OUTPUT
  71. ;==================
  72. ;
  73. ;output register to immediate I/O address
  74. ;format: OUT0    (m),r    (m = byte value, r = B/C/D/E/H/L/A)
  75. ;
  76. ;correct:
  77. ;
  78.     OUT0    (2),C
  79. PIO    EQU    40H
  80.     OUT0    (PIO),L
  81.     OUT0    (0FFH),E
  82. ;
  83. ;wrong:
  84. ;
  85.     OUT0    2,C
  86.     OUT0
  87.     OUT0    C
  88.     OUT0    3
  89.     OUT0    (E),C
  90.     OUT0    (3),(HL)    ;even the HD64180 is not a two-address machine
  91.     OUT0    (EGON),D
  92. ;
  93. ;==================
  94. ;    INPUT
  95. ;==================
  96. ;
  97. ;input from immediate I/O address to register
  98. ;format: IN0    r,(m)    (m = byte value, r = B/C/D/E/H/L/A)
  99. ;
  100. ;correct:
  101. ;
  102.     IN0    A,(2)
  103.     IN0    C,(PIO)
  104. ;
  105. ;wrong:
  106. ;
  107.     IN0    A,(C)
  108.     IN0    (HL),(3)
  109.     IN0    A,3
  110.     IN0
  111. ;
  112. ;==================
  113. ;    BLOCK OUTPUT
  114. ;==================
  115. ;
  116. ;the contents of memory pointed to by HL is output to the I/O address
  117. ;in (C). The memory address (HL) and I/O address (C) are incremented
  118. ;in OTIM and OTIMR and decremented in OTDR and OTDMR respectively.
  119. ;B register is decremented. The OTIMR and OTDMR variants repeat the
  120. ;above sequence until register B is decremented to 0.
  121. ;
  122. ;correct:
  123. ;
  124.     OTIM
  125.     OTIMR
  126.     OTDM
  127.     OTDMR
  128. ;
  129. ;wrong:
  130. ;
  131.     OTIM    EGON
  132.     OTIM    3
  133.     OTIM    C
  134.     OTIM    (HL)
  135. ;
  136. ;==================
  137. ;    LOGICAL
  138. ;==================
  139. ;
  140. ;Non-destructive AND, I/O port and accumulator
  141. ;format: TSTIO    m    (m = byte value)
  142. ;
  143. ;correct:
  144. ;
  145.     TSTIO    2
  146.     TSTIO    PIO
  147. ;
  148. ;wrong:
  149. ;
  150.     TSTIO
  151.     TSTIO    C
  152.     TSTIO    (IX+12)
  153.     TSTIO    EGON
  154. ;
  155. ;==================
  156. ;    LOGICAL TEST
  157. ;==================
  158. ;
  159. ;Non-destructive AND, register/immediate/memory and accumulator
  160. ;format: TST    g    (g = B/C/D/E/H/L/A)
  161. ;     TST    m    (m = byte value)
  162. ;     TST    (HL)
  163. ;
  164. ;correct:
  165. ;
  166.     TST    A
  167.     TST    (HL)
  168.     TST    PIO
  169.     TST    14
  170. ;
  171. ;wrong:
  172. ;
  173.     TST
  174.     TST    (IX+2)
  175.     TST    EGON
  176. ;
  177. ;==================
  178. ;
  179.     .8080
  180. ;
  181. ;these new instructions only work in Z80 mode, of course:
  182. ;
  183.     SLP
  184.     IN0    A,(56)
  185.     OUT0    (23),L
  186.     MLT    HL
  187.     OTIM
  188.     OTIMR
  189.     OTDM
  190.     OTDMR
  191.     TSTIO    23
  192.     TST    C
  193.     TST    (HL)
  194.     TST    15
  195. ;
  196. ;==================
  197. ;
  198.     END
  199.