Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- program trojwymiar;
- #include("stdlib.hhf");
- static
- tab3: int32[3,4,5]:= [111,112,113,114,115,
- 121,122,123,124,125,
- 131,132,133,134,135,
- 141,142,143,144,145,
- 211,212,213,214,215,
- 221,222,223,224,225,
- 231,232,233,234,235,
- 241,242,243,244,245,
- 311,312,313,314,315,
- 321,322,323,324,325,
- 331,332,333,334,335,
- 341,342,343,344,345,];
- kolumna: int32;
- wiersz: int32;
- warstwa: int32;
- begin trojwymiar;
- stdout.put("Podaj kolumne: ", nl);
- stdin.get(kolumna);
- if(kolumna <= 5)then
- dec(kolumna);
- else
- stdout.put("Podano niewlasciwa kolumne!! Prosze podac nowa", nl);
- stdin.get(kolumna);
- dec(kolumna);
- endif;
- stdout.put("Podaj wiersz: ", nl);
- stdin.get(wiersz);
- dec(wiersz);
- stdout.put("Podaj warstwe: ", nl);
- stdin.get(warstwa);
- dec(warstwa);
- mov(warstwa, EAX);
- intmul(4, EAX);
- add(wiersz, EAX);
- intmul(5,EAX);
- add(kolumna, EAX);
- stdout.put(" Wybrany element ma wartosc: ", tab3[EAX*4], nl);
- end trojwymiar;
- 2. Zerowanie tablicy
- program procedurki;
- #include("stdlib.hhf");
- static
- tabliczka: int32[257];
- i: int32:= 0;
- procedure zerowanko;
- static
- j: int32:=0;
- hooy: int32;
- begin zerowanko;
- stdout.put("Podaj numer od ktorego chcesz zerowac", nl);
- stdin.get(hooy);
- mov(hooy,ECX);
- stdout.puti32(ECX);
- stdout.newln();
- if(ECX > 256 || ECX < 1) then
- stdout.put("Podano niewlasciwy numer, prosze poprawic", nl);
- stdin.get(hooy);
- mov(hooy,ECX);
- dec(ECX);
- else
- stdout.put("Wszysko dziala", nl);
- dec(ECX);
- endif;
- //mov(33,ECX);
- for(mov(j,EAX); j<256; inc(j)) do
- if(ECX > j) then
- mov(j,EBX);
- add(1,EBX);
- mov(EBX, tabliczka[EAX]);
- stdout.put(tabliczka[EAX]:4);
- else
- mov(0, tabliczka[EAX]);
- stdout.put(tabliczka[EAX]:4);
- endif;
- endfor;
- end zerowanko;
- begin procedurki;
- mov(1,EBX);
- for(mov(i,EAX); i<256; inc(i)) do
- mov(EBX, tabliczka[EAX]);
- stdout.put(tabliczka[EAX]:4);
- add(1,EBX);
- endfor;
- zerowanko();
- end procedurki;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement