1
0

test.asm 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ;; This file is part of asmc, a bootstrapping OS with minimal seed
  2. ;; Copyright (C) 2018 Giovanni Mascellani <gio@debian.org>
  3. ;; https://gitlab.com/giomasce/asmc
  4. ;; This program is free software: you can redistribute it and/or modify
  5. ;; it under the terms of the GNU General Public License as published by
  6. ;; the Free Software Foundation, either version 3 of the License, or
  7. ;; (at your option) any later version.
  8. ;; This program is distributed in the hope that it will be useful,
  9. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ;; GNU General Public License for more details.
  12. ;; You should have received a copy of the GNU General Public License
  13. ;; along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. first:
  15. add eax, ebx ; Test line
  16. add eax, 0x2200
  17. add al, 0x22
  18. second:
  19. add byte [eax+second+eax], 0x22
  20. add ebx, [eax+second+eax]
  21. add bh, [eax+second+eax]
  22. add dword [eax+second+eax], 0x22
  23. add al, second
  24. mul edx
  25. neg BYTE [edx]
  26. not dWoRd [edx+ebx*4+0x2244]
  27. jmp first
  28. call second
  29. jmp [eax]
  30. call [eax+ebx*2]
  31. third:
  32. jz third
  33. je third
  34. ja third
  35. jna third
  36. jc third
  37. ret
  38. push eax
  39. push ebx
  40. push [eax+ebx*2+first]
  41. push first
  42. push 0xff5500
  43. pop eax
  44. pop ebx
  45. int 0x80
  46. sal al, 10
  47. shl DWORD [eax], 12
  48. sar BYTE [eax], cl
  49. shr cl, cl
  50. shld edx, eax, 2
  51. shld [edx], eax, cl
  52. shrd edx, eax, 2
  53. shrd [edx], eax, cl
  54. shl bx, 15
  55. inc bx
  56. movzx eax, byte [ebx]
  57. movsx eax, word [ebx]
  58. movzx eax, cx
  59. movsx eax, ch
  60. movzx ax,byte [esi]
  61. inc ebx
  62. dec ah
  63. stc
  64. std
  65. sti
  66. cmc
  67. clc
  68. cld
  69. cli
  70. here:
  71. rep stosb
  72. stosw
  73. stosd
  74. lodsb
  75. lodsw
  76. lodsd
  77. there:
  78. rep stos byte [eax]
  79. stos word [ebx]
  80. stos dword [edi]
  81. lods byte [eax]
  82. rep lods word [ebx]
  83. lods dword [edi]
  84. xchg eax, ebx
  85. xchg ecx, [edx+'abc']
  86. seta byte [ebp+10101110b]
  87. setne byte [ebp+eax*4+100H]
  88. jecxz here
  89. jcxz here
  90. jmp here
  91. ;; jecxz first
  92. jmp first
  93. loope here
  94. xlat byte [edx]
  95. xlatb
  96. lea esi, [esi+ecx-10]
  97. mov ax, 20
  98. mov eax, there-here+4
  99. bt [eax+0x345], 3
  100. btc [0x345], 4
  101. btr eax, 5
  102. bts [ebx+ecx*8+0x1234], 6
  103. bt ax, 10
  104. mov eax, 1 + 1 shl 8
  105. mov eax, -1
  106. mov eax, not 1
  107. mov ebx, 'fas'+1Ah shl 24
  108. push eax ebx ecx
  109. imul ecx
  110. imul ecx, [edx]
  111. imul ebx, [edx], 0x10
  112. cbw
  113. cwde
  114. bsf eax, [edi]
  115. bsr eax, [edi]
  116. mov ecx, 0x10000000
  117. rdpmc
  118. dd there-here
  119. dw there-here,10,11,there-here
  120. dd 0x11223344
  121. rw 2
  122. db 'Hello world!',0xa,0,-1