Created
April 7, 2012 16:18
-
-
Save libbkmz/2330071 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
start: 1000 | |
#; задание: из массива А скопировать в массив В элементы которые удовлетворяют условию: | |
#; нечетное и делится на 5 | |
lxi h,1100 | |
lxi d,1200 | |
mov b,m | |
call 1090 ; заканчиваем или нет | |
mov a,b | |
ani 1 ; проверка на четность | |
cnz 1050 | |
inx h | |
jmp 1006 | |
#; функция копирует значение в новый массив | |
addr: 1050 | |
mov a,b | |
stax d | |
inx d | |
ret | |
#; функция проверки окончания массива | |
addr: 1090 | |
inr b; если ff, то z=1 следовательно заканчиваем | |
jz 10f0 | |
dcr b | |
ret | |
addr: 10f0 | |
mvi a,ff | |
stax d | |
hlt | |
addr: 1100 | |
01 | |
02 | |
03 | |
04 | |
05 | |
06 | |
07 | |
08 | |
09 | |
0a | |
ff | |
addr: 1400 | |
lxi h,1200 | |
lxi d,1300 | |
mov b,m | |
call 1090 | |
mov a,b | |
ora a | |
sui 5 | |
cz 140b | |
cp 1050 | |
inx h | |
jmp 1406 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment