Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#x86, (削除) 42 (削除ここまで) 40 bytes

x86, (削除) 42 (削除ここまで) 40 bytes

#x86, 256 bytes

x86, 256 bytes

#x86, (削除) 42 (削除ここまで) 40 bytes

#x86, 256 bytes

x86, (削除) 42 (削除ここまで) 40 bytes

x86, 256 bytes

added 9 characters in body
Source Link
qwr
  • 12.4k
  • 6
  • 49
  • 82
.section .text
.globl main
main:
 mov 0ドルxff, %eax
start:
 push 20ドル # program length
 pop %ecx # counter
 mov $str, %edi # load string
loop:
 scasb # cmpif edx,(al *edi== *(edi++)) 
 jne loop1 # if (al == *(edi++))
 mov 2,ドル %al # ret 2
end: ret 
loop1:
 loop loop # do while (--counter)
 xor %eax, %eax # ret 0
 jmp end
str: .byte 0x6a,0x14,0x59,0xbf,0xf4,0x83,0x04,0x08 
 .byte 0xae,0x75,0x03,0xb0,0x02,0xc3,0xe2,0xf8
 .byte 0x31,0xc0,0xeb,0xf9 
.section .text
.globl main
main:
 mov 0ドルxff, %eax
start:
 push 20ドル # program length
 pop %ecx # counter
 mov $str, %edi # load string
loop:
 scasb # cmp edx, *edi 
 jne loop1 # if (al == *(edi++))
 mov 2,ドル %al # ret 2
end: ret 
loop1:
 loop loop
 xor %eax, %eax # ret 0
 jmp end
str: .byte 0x6a,0x14,0x59,0xbf,0xf4,0x83,0x04,0x08 
 .byte 0xae,0x75,0x03,0xb0,0x02,0xc3,0xe2,0xf8
 .byte 0x31,0xc0,0xeb,0xf9 
.section .text
.globl main
main:
 mov 0ドルxff, %eax
start:
 push 20ドル # program length
 pop %ecx # counter
 mov $str, %edi # load string
loop:
 scasb # if (al == *(edi++)) 
 jne loop1 
 mov 2,ドル %al # ret 2
end: ret 
loop1:
 loop loop # do while (--counter)
 xor %eax, %eax # ret 0
 jmp end
str: .byte 0x6a,0x14,0x59,0xbf,0xf4,0x83,0x04,0x08 
 .byte 0xae,0x75,0x03,0xb0,0x02,0xc3,0xe2,0xf8
 .byte 0x31,0xc0,0xeb,0xf9 
edited body
Source Link
qwr
  • 12.4k
  • 6
  • 49
  • 82

Here I use the same strategy as others: Create a string copy of the program with unique bytes, then return 2 in al if the input al is in the string. If we allow ourselves to read code that is actually run, we get l4m2's solution .

Here I use the same strategy as others: Create a string copy of the program with unique bytes, then return 2 in al if the input al is in the string.

Here I use the same strategy as others: Create a string copy of the program with unique bytes, then return 2 in al if the input al is in the string. If we allow ourselves to read code that is actually run, we get l4m2's solution .

edited body
Source Link
qwr
  • 12.4k
  • 6
  • 49
  • 82
Loading
added 113 characters in body
Source Link
qwr
  • 12.4k
  • 6
  • 49
  • 82
Loading
added 3 characters in body
Source Link
qwr
  • 12.4k
  • 6
  • 49
  • 82
Loading
added 8 characters in body
Source Link
qwr
  • 12.4k
  • 6
  • 49
  • 82
Loading
added 1368 characters in body
Source Link
qwr
  • 12.4k
  • 6
  • 49
  • 82
Loading
Source Link
qwr
  • 12.4k
  • 6
  • 49
  • 82
Loading

AltStyle によって変換されたページ (->オリジナル) /