the problem is that the delay seems to ignore the changes. what am I doing wrong?
- Code: Select all
; tempo random
; 1 March 2015
org 100h
mvi a,03h
out 10h
mvi a,15
out 10h
lxi h,200h ;initialise random number gen. by reading 200h
start mvi a,'+' ;output an ASCII + to monitor the delay routine
out 11h
random mov a,m ;random number generator
rrc
add m
rrc
mov m,a
inx h
xra m
mov m,a
ani 7o
inr a
tempo set a ;0 to 7 should be assigned to variable "tempo"
lxi d,tempo*5000 ;this is the problem, I've tried also other things like "lxi d,a*5000", no luck
delay dcx d
mov a,d
ora e
jnz delay
jmp start
end
sorry for the bad formatting, switching between PC and Mac makes some mess