Advertisement
Paszta

Niskopoziomówka laby8

Dec 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. 1.
  2. program tescior;
  3. #include("stdlib.hhf");
  4. static
  5.  
  6. procedure gigancior;
  7. begin gigancior;
  8. push(ECX);
  9. for(mov(0,ECX); ECX<40; inc(ECX)) do
  10. stdout.put(" ");
  11. endfor;
  12. stdout.put("*");
  13. pop(ECX);
  14. end gigancior;
  15.  
  16. begin tescior;
  17. mov(20, ECX);
  18. repeat
  19. gigancior();
  20. dec(ECX);
  21. stdout.newln();
  22. until(ECX==0);
  23.  
  24. end tescior;
  25.  
  26. 2.
  27. program tescior;
  28. #include("stdlib.hhf");
  29. static
  30. a: int32:= 100;
  31. b: int32:= 200;
  32.  
  33. procedure gigancior;
  34. static
  35. i: int32;
  36. var
  37. a: int32;
  38. b: int32;
  39.  
  40. begin gigancior;
  41.  
  42. mov(10,a);
  43. mov(0,b);
  44. mov(5,i);
  45.  
  46. repeat
  47. inc(a);
  48. dec(b);
  49. dec(i);
  50. until(i=0);
  51.  
  52. stdout.put(" Zmienna a: ", a, nl);
  53. stdout.put(" Zmienna b: ", b, nl);
  54.  
  55. end gigancior;
  56.  
  57. begin tescior;
  58.  
  59. gigancior();
  60.  
  61. stdout.put(" Zmienna glob a: ", a, nl);
  62. stdout.put(" Zmienna glob b: ", b, nl);
  63. end tescior;
  64. 3.
  65.  
  66. program tescior;
  67. #include("stdlib.hhf");
  68. static
  69. znak: char;
  70. licznik: int32;
  71.  
  72. procedure gigancior(znak: char; licznik: int32);
  73. static
  74.  
  75. begin gigancior;
  76.  
  77. repeat
  78. stdout.put(znak, nl);
  79. dec(licznik);
  80. until(licznik = 0);
  81.  
  82. end gigancior;
  83.  
  84. begin tescior;
  85.  
  86.  
  87. stdout.put(" Jaki znak: ", nl);
  88. stdin.get(znak);
  89. stdout.put(" Ile razy ", nl);
  90. stdin.get(licznik);
  91.  
  92. gigancior(znak, licznik);
  93.  
  94. end tescior;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement