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

  1. tc te2 qc
  2.  
  3.  
  4.  
  5.  
  6.  
  7.   ┌──────────────────────┐
  8.   │ WELCOME TO LESSON 4  │
  9.   └──────────────────────┘
  10.  
  11.  
  12.  
  13. !qp
  14.  
  15.  This lesson let you learn how to
  16.  master the data train input command.
  17.  
  18.  The Z80 instruction "INDR" will be used
  19.  to write a sequence of data from the
  20.  selected port 08H into its memory location
  21.  starting backward 1050H, 104FH.......
  22.  
  23. !qp
  24.  
  25.  First step is to activate Z80's ruler files
  26.  
  27. !fc z80
  28.  
  29.  First let's take a look at memory
  30.  locations 1020H to 1058H.
  31.  
  32. !pm1020
  33. !m32
  34.  
  35. !qp
  36.  
  37.  Assemble the instruction "INDR", beginning at 1000H.
  38.  
  39. !pa1000
  40. !a INDR
  41. !a STP
  42.  
  43. !qp
  44.  
  45.  The selected I/O port address, 08H, will be stored
  46.  in C register while the starting destination
  47.  address, 1050H, will be stored in register pair HL.
  48.  
  49.  A counter of 28H for B register will be decremented
  50.  for each step and the execution will be terminated
  51.  when B register reaches zero.
  52.  
  53. !rxb,28
  54. !rxc,08
  55. !rxh,10
  56. !rxl,50
  57. !rp
  58.  
  59. !qp
  60.  
  61. !xm 08 l06 N11 N22 N33 N44 E00 N55 N66 N77 N88 S99
  62.  
  63.  The data train input command "xm" above will introduce
  64.  a series of data into the I/O port 08H one by one.
  65.  
  66.  This series of data will begin with
  67.  11H, followed by 22H, 33H, and 44H.
  68.  This first set of numbers "11H, 22H, 33H, 44H"
  69.  will be repeated five more times.
  70.  After that numbers 55H, 66H, 77H and 88H will append.
  71.  The last data "s99" makes the last value stay at 99H.
  72.  
  73. !qp
  74.  
  75. !ps1000
  76. !s
  77. !m32
  78.  
  79.  After one step B changed to 27 and HL changed to 104F.
  80.  The first number in the data train, 11H, was stored in 1050H.
  81. !qp
  82.  
  83. !s
  84.  
  85. !m32
  86.  
  87.  Another step of execution decremented B and HL again,
  88.  and stored the second value in the data train, 22H,
  89.  into location 104FH.
  90.  
  91. !qp
  92.  
  93. !s
  94.  
  95. !m32
  96.  
  97.  Another step of execution decremented B and HL again, and
  98.  stored the third number in data train, 33H, into 104EH.
  99.  
  100. !qp
  101. The next command will execute the rest of the step.
  102.  
  103. !sg
  104. !m32
  105.  
  106.  The display above shows how instruction "INDR"
  107.  stored the sequence of data available at the I/O
  108.  port 08H into memory locations 1029H to 1050H.
  109.  
  110.  You can also see that when B becomes 0
  111.  HL becomes 1028H.
  112. !qp
  113.  
  114.  Use the "qq" command to exit from UMPS.
  115.