home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
LA
/
LA026.ZIP
/
LN3.SIM
< prev
next >
Wrap
Text File
|
1990-10-16
|
3KB
|
186 lines
te1
qc
!
!
!
!
!
! ┌──────────────────────┐
! │ WELCOME TO LESSON 3 │
! └──────────────────────┘
!
!
!
qp
!
! This lesson let you use the batch file
! 8085bd.sim to practice the UMPS's break function.
!
! The subroutine in 8085bd.sim can change your
! binary data starting from 0700H into binary
! coded decimal (BCD) data starting from 0708H.
!
qp
!
fc 8085
pa1000
ay
xra a
mov b,e
lxi h ,0708h
mov m,a
inx h
dcr b
jnz 1005h
mov a,d
add a
add a
add a
mov c,a
mvi l,00h
mov b,d
mov a,m
ral
mov m,a
inx h
dcr b
jnz 1013h
mvi l,08h
mov b,e
mov a,m
adc a
daa
mov m,a
inx h
dcr b
jnz 101eh
dcr c
jnz 1010h
stp
end
!
!
! The 8085bd.sim file is loaded into
! locations 1000H to 102BH.
!
qp
!
! At the beginning the number of bytes
! for the binary data and BCD data need to
! be loaded into D and E registers respectively.
!
! Set registers D=2, E=3 by the "rx" command.
!
rxd,2
rxe,3
!
! The next command "rp" lists the values
! of all the registers and flags.
!
rp
!
qp
!
! Store the binary data 1100 1101 (CD) into 0700H.
!
pi0700
ix cd
pm0700
m8
!
qp
!
! There is a loop beginning at 1010H
! If C register (detected at 1028H) is
! not set to zero there will be a jump to 1010H.
!
! Let's set a break point at 1028H.
!
bp1028
bl
!
qp
! Let's execute the first loop and look at the result.
!
ps1000
!
sg
!
m8
!
! After the first loop C=0F.
! At 0700H "CD" (1100 1101) rotated left
! through carry and became "9A" (1001 1010)
! At 0701H "00" rotated left through carry and became "01".
qp
!
sg
!
m8
!
! After the second loop C=0E.
! At 0700H "9A" rotated left through carry and became "34".
! At 0701H "01" rotated left through carry and became "03".
!
qp
!
! You already have seen what each loop does.
! To see the result from the rest of the loops
! just erase the break point at 1028H.
!
be1028
bl
!
sg
!
m8
!
! The binary data "CD" stored at 0700H has been changed
! to BCD "0205" and stored into 0709H and 0708H.
!
qp
!
!
! To see what the BCD value is for the biggest
! four bytes of binary data "FF FF FF FF",
! enter the following:
!
rxd,4
rxe,5
!
pi0700
ix FF FF FF FF
m8
!
qp
!
ps1000
!
sg
!
m8
!
! The binary data "FF FF FF FF" before the
! execution from 0703H to 0700H has been changed
! to BCD data "4,294,967,295" from 070CH to 0708H.
!
qp
!
! The subroutines in files 6502bd.sim,
! 6800bd.sim and z80bd.sim have the same
! function as the subroutine in 8085bd.sim.
!
! Initially, the number of bytes of the
! binary data and BCD data need to be loaded
! into the D and E register for the z80
! whereas for the 6502 and 6800 this information
! must be stored into locations $0710 and $0711.
!
!
qp
!
! Use the command "fb ln4.sim"
! to learn the UMPS lesson 4.
! Use the command "qq" to exit from UMPS.
!