Сделаю рекурсию. Добавлю модификаторы _static, _stack. Пока не до этого, пока у меня даже комментарии не поддерживаются.
---------- Post added at 01:22 ---------- Previous post was at 00:52 ----------
Прикольно. Написал
x=32; y=15;
while(1) {
i=getch();
print(x, y, "+");
if(i==0x19) { if(y>0) --y; } else
if(i==0x08) { if(x>0) --x; } else
if(i==0x1A) { if(y<24) ++y; } else
if(i==0x18) { if(x<63) ++x; }
print(x, y, "O");
}
сижу рисую.Теперь жизнь станет проще, а программы круче.
---------- Post added at 01:36 ---------- Previous post was at 01:22 ----------
Код:Программа struct File { ushort some1, size; uchar name[11]; uchar some2; }; File files[24]; void main() { register uchar i; File* f; clrscr(); for(f=files, i=0; i<24; ++i, ++f) itoa(f->name, i); for(i=0; i<16; ++i) print(0, i, files[i].name); while(1); } files ds 384 main_f ds 2 main: push bc ; 49 clrscr(); call clrscr ; 51 for(f=files, i=0; i<24; ++i, ++f) ld hl, files ld (main_f), hl ld b, 0 l12: ld a, b cp 24 jp nc, l13 ; 52 atoi(f->name, i); ld hl, (main_f) inc hl inc hl inc hl inc hl ld (atoi_str1), hl ld l, b ld h, 0 call atoi inc b ld hl, (main_f) ld de, 16 add hl, de ld (main_f), hl jp l12 l13: ; 54 for(i=0; i<16; ++i) ld b, 0 l15: ld a, b cp 16 jp nc, l16 ; 55 print(0, i, files[i].name); xor a ld (print_x), a ld a, b ld (print_y), a ld l, b ld h, 0 add hl, hl add hl, hl add hl, hl add hl, hl ld de, files add hl, de inc hl inc hl inc hl inc hl call print inc b jp l15 l16: ; 57 while(1); l18: jp l18 l19: l11: pop bc ret





Ответить с цитированием