home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
LA
/
LA026.ZIP
/
LN4.SIM
< prev
next >
Wrap
Text File
|
1990-10-14
|
2KB
|
115 lines
tc te2 qc
┌──────────────────────┐
│ WELCOME TO LESSON 4 │
└──────────────────────┘
!qp
This lesson let you learn how to
master the data train input command.
The Z80 instruction "INDR" will be used
to write a sequence of data from the
selected port 08H into its memory location
starting backward 1050H, 104FH.......
!qp
First step is to activate Z80's ruler files
!fc z80
First let's take a look at memory
locations 1020H to 1058H.
!pm1020
!m32
!qp
Assemble the instruction "INDR", beginning at 1000H.
!pa1000
!a INDR
!a STP
!qp
The selected I/O port address, 08H, will be stored
in C register while the starting destination
address, 1050H, will be stored in register pair HL.
A counter of 28H for B register will be decremented
for each step and the execution will be terminated
when B register reaches zero.
!rxb,28
!rxc,08
!rxh,10
!rxl,50
!rp
!qp
!xm 08 l06 N11 N22 N33 N44 E00 N55 N66 N77 N88 S99
The data train input command "xm" above will introduce
a series of data into the I/O port 08H one by one.
This series of data will begin with
11H, followed by 22H, 33H, and 44H.
This first set of numbers "11H, 22H, 33H, 44H"
will be repeated five more times.
After that numbers 55H, 66H, 77H and 88H will append.
The last data "s99" makes the last value stay at 99H.
!qp
!ps1000
!s
!m32
After one step B changed to 27 and HL changed to 104F.
The first number in the data train, 11H, was stored in 1050H.
!qp
!s
!m32
Another step of execution decremented B and HL again,
and stored the second value in the data train, 22H,
into location 104FH.
!qp
!s
!m32
Another step of execution decremented B and HL again, and
stored the third number in data train, 33H, into 104EH.
!qp
The next command will execute the rest of the step.
!sg
!m32
The display above shows how instruction "INDR"
stored the sequence of data available at the I/O
port 08H into memory locations 1029H to 1050H.
You can also see that when B becomes 0
HL becomes 1028H.
!qp
Use the "qq" command to exit from UMPS.