Created
May 23, 2012 13:38
-
-
Save libbkmz/2775270 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 | |
lxi h,1100 ; адрес начала массива с данными | |
mov b,m ; сохраняем значение первого элемента | |
inr L ; TODO переполнение | |
mov a,m | |
call 1030 ; заканчиваем или нет | |
ora a ; сброс флага переноса | |
cmp b | |
jc 1004 ; переходим на следующий элемент массива | |
mov b,m ; сохраняем нужный элемент | |
mov c,l ; и его индекс | |
jmp 1004 | |
addr: 1020 | |
hlt | |
addr: 1030 | |
inr a; для окончания хождения по массиву | |
jz 1020 | |
dcr a | |
ret | |
#;массив | |
addr: 1100 | |
10 | |
12 | |
05 | |
31 | |
29 | |
07 | |
15 | |
56 | |
ff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment