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 Revisions

3 of 3
Commonmark migration

x86-16 machine code, IBM PC DOS, (削除) 27 (削除ここまで) 23 bytes

Binary:

00000000: b408 cd21 b40e cd10 483c 617d f9b0 0acd ...!....H<a}....
00000010: 10b0 0dcd 10eb e9 .......

Test and build using xxd -r from above.

Unassembled:

 IN_LOOP: 
B4 08 MOV AH, 08H ; DOS read char without echo function
CD 21 INT 21H ; load next char from STDIN
B4 0E MOV AH, 0EH ; BIOS write char teletype output function
 CHR_LOOP: 
CD 10 INT 10H ; write to console 
48 DEC AX ; move to next char 
3C 61 CMP AL, 'a' ; end with an 'a' 
7D F9 JGE CHR_LOOP ; keep looping descending chars 
B0 0A MOV AL, 0AH ; CR char 
CD 10 INT 10H ; write to console 
B0 0D MOV AL, 0DH ; LF char 
CD 10 INT 10H ; write to console 
EB E9 JMP IN_LOOP ; keep looping until ^C/^Break

I/O:

Input via STDIN or interactive input, output to console. Will run until EOF or ^C/^Break.

enter image description here

Iterative approach. Of course, it's 8 bytes just to write a newline character...

640KB
  • 12.4k
  • 2
  • 38
  • 61

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