Сборный / Говнокод #25370 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
format pe console 5.0

entry start

include 'win32ax.inc'

SLEEP=1000

section '.data' data readable

  _hello db 'Hello "https://www.govnokod.ru/"!',13,10,0
  _conout db 'CONOUT$',0
  align 8
  _conoutnt du '\??\CONOUT$',0

section '.data?' data readable writeable

  bytes_write dd ?
  houtput dd ?
  length dd ?

section '.text' code readable executable

start:
  call _novice
  invoke Sleep,SLEEP
  call _advanced
  invoke Sleep,SLEEP
  call _psycho
  invoke Sleep,SLEEP
  invoke ExitProcess,0

_novice:
  invoke GetStdHandle,STD_OUTPUT_HANDLE
  mov [houtput],eax
  invoke lstrlen,_hello
  mov [length],eax
  invoke WriteConsole,[houtput],_hello,[length],bytes_write,0
  ret

_advanced:
  invoke CreateFileA,_conout,GENERIC_WRITE,0,0,OPEN_EXISTING,0,0
  mov [houtput],eax
  invoke lstrlen,_hello
  mov [length],eax
  invoke WriteFile,[houtput],_hello,[length],bytes_write,0
  invoke CloseHandle,[houtput]
  ret

_psycho:
  push ebx
  sub esp,40
  mov ebx,esp
  mov word[ebx+24],22
  mov word[ebx+26],24
  mov dword[ebx+28],_conoutnt
  mov dword[ebx+0],24
  mov dword[ebx+4],0
  lea eax,[ebx+24]
  mov dword[ebx+8],eax
  mov dword[ebx+12],$00000040
  mov dword[ebx+16],0
  mov dword[ebx+20],0
  lea eax,[ebx+32]
  invoke NtCreateFile,houtput,$40100080,ebx,eax,0,0,0,1,$60,0,0
  invoke lstrlen,_hello
  mov [length],eax
  lea eax,[ebx+32]
  invoke NtWriteFile,[houtput],0,0,0,eax,_hello,[length],0,0
  invoke NtClose,[houtput]
  add esp,40
  pop ebx
  ret

section '.import' data import readable

  library\
    ntdll,'ntdll.dll',\
    kernel32,'kernel32.dll'

  import ntdll,\
    NtClose,'NtClose',\
    NtCreateFile,'NtCreateFile',\
    NtWriteFile,'NtWriteFile'

  include 'api\kernel32.inc'

section '.reloc' fixups data readable discardable

Интересно какой из методов (_novice, _advanced, _psycho) вывода в консоль является говнокодом?

chiacorp chiacorp, (Updated )

Комментарии (57, +57)

Сборный / Говнокод #25249 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
execute = 0
i = 100
while i < $
    load a byte from i
    if a = 0xc3
        execute = i
        i = $
    else
        i = i + 1
    end if
end while

if execute = 0
display "ret not found", 13, 10
execute = $
ret
end if

Прежде чем объявлять подпрограмму, тсарь пройдётся по уже собранному коду в поисках нужных ему байт.

3oJloTou_neTyx 3oJloTou_neTyx, (Updated )

Комментарии (23, +23)

Сборный / Говнокод #25239 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
https://www.researchgate.net/publication/325358150_cQASM_v10_Towards_a_Common_Quantum_Assembly_Language

cQASM v1.0: Towards a Common Quantum Assembly Language

The quantum assembly language (QASM) is a popular intermediate representation used in many quantum compilation and simulation tools to describe quantum circuits. Currently, multiple different dialects of QASM are used in different quantum computing tools. This makes the interaction between those tools tedious and time-consuming due to the need for translators between theses different syntaxes. Beside requiring a multitude of translators, the translation process exposes the constant risk of loosing information due to the potential incompatibilities between the different dialects. Moreover, several tools introduce details of specific target hardware or qubit technologies within the QASM syntax and prevent porting the code to other hardwares. In this paper, we propose a common QASM syntax definition, named cQASM, which aims to abstract away qubit technology details and guarantee the interoperability between all the quantum compilation and simulation tools supporting this standard. Our vision is to enable an extensive quantum computing toolbox shared by all the quantum computing community.

Вот это я понимаю, а то вон там мелкософт какие-то говношарпы придумывает очередные:

https://docs.microsoft.com/en-us/quantum/language/?view=qsharp-preview


Нахер ваши шарпы с вашим сраным дуднетом и прочей такой хуйней, даешь Assembler.

j123123 j123123, (Updated )

Комментарии (187, +187)

Сборный / Говнокод #25228 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
/*
x86-64 clang (trunk) -O3
https://godbolt.org/z/t8NDGG

#include <inttypes.h>

uint32_t saturation_add(uint32_t a, uint32_t b)
{
    const uint64_t tmp = (uint64_t)a + b;
    if (tmp > UINT32_MAX)
    {
        return UINT32_MAX;
    }
    return tmp;
}
*/

saturation_add:
        mov     edx, esi
        mov     eax, edi
        add     edi, esi
        add     rax, rdx
        mov     edx, 4294967295
        cmp     rax, rdx
        mov     eax, -1   // ЗАЧЕМ???
        cmovbe  eax, edi
        ret

https://en.wikipedia.org/wiki/Saturation_arithmetic
Почему компиляторы до сих пор такое говно

j123123 j123123, (Updated )

Комментарии (94, +94)

Сборный / Говнокод #25114 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
DEF "PARSE", 0, PARSE
    MOV    SI, [VAR_TO_IN]
    MOV    CX, [VAR_NTIB]
    SUB    CX, SI
    ADD    SI, [VAR_TIB]
    SUB    BP, 2
    MOV    [BP], SI
    REPNE  SCASB
    SUB    CX, [VAR_NTIB]
    NOT    CX
    MOV    [VAR_TO_IN], CX
    MOV    AX, SI
    SUB    AX, [BP]
    DEC    AX
    RET

СУКА! УЖЕ В КОТОРЫЙ РАЗ ЗАБЫВАЮ, ЧТО У SCAS ИСПОЛЬЗУЕТСЯ DI, А НЕ SI.

UPPERCASE UPPERCASE, (Updated )

Комментарии (21, +21)

Сборный / Говнокод #25053 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
ㅌㄹ ㄱㅌ		; Помещаем в BX текущее значение регистра ES	<───────┐
ㅈㅿ		; Загружаем младший байт регистра флагов в AH		│
		;							│
ㅊㅋ		; В пару ES:DI кладем то, что сейчас находится в AX	│
		;							|
ㄹㅅ		; Дважды увеличиваем значение регистра DI		|
ㄹㅅ		; на одну единицу					|
		;							│
ㅎㅋ ㅿㅈ		; Образуем бесконечный цикл			>───────┘

Господа, ОНО вернулось. Следующая итерация всеми нами любимого и восхваляемого [имя, которое нель̸̗̠̘̘̪̳̩зя произносить]. Я б̞̫͔̜ы на вашем ме̤̣̺͇̫с̨͈те покинул стр̵а̻̘̪̙͎̳̕н̬̙̤̙̪̝̺͠ицу. С̫е̜й̱͎ч̦̦̝͔а̙͓͓с̛̩̞̘ ̫̹͙̲̤̖͉ж̶͉̻е҉̼̦.

h7381514 h7381514, (Updated )

Комментарии (50, +50)

Сборный / Говнокод #24834 Ссылка на оригинал

0

  1. 1
https://github.com/Microsoft/MS-DOS/tree/master/v2.0/source

[MS-DOS 1.25 & 2.0 Source] Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, freeof charge, to any person obtaining a copy of this software and associateddocumentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,merge, publish, distribute, sublicense, and/or sell copies of the Software, andto permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice andthis permission notice shall be included in all copies or substantial portionsof the Software.

THE SOFTWARE IS PROVIDED AS IS,WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TOTHE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLEFOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE ORTHE USE OR OTHER DEALINGS IN THE SOFTWARE.

j123123 j123123, (Updated )

Комментарии (19, +19)

Сборный / Говнокод #24779 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
.def temp = r16
.def rr1 = r17
.org 0
Ldi r16, low(RAMEND)
out SPL, temp
Ldi r16 high(RANEND)
out SPH, temp

rjmp start
start:
ldi temp,255
out DDRB, temp
out PORTB,temp
rcall delay
Ldi temp,0x00
out PORTB,temp
Rcall delay
rjmp start

delay:
ldi rr1, 0xFF
Pdelay:
Dec rr1
brne Pdrlay
ret

Почему микроконтроллер не мигает лампочка?
Но студия не ругается
(Ассемблер АVR)

Arduino Arduino, (Updated )

Комментарии (44, +44)