Skip to main content
Commonmark migration
Source Link

#x86-16 machine code, IBM PC DOS, 14 12 bytes

x86-16 machine code, IBM PC DOS, 14 12 bytes

Binary:

00000000: b401 cd21 f7d9 78f8 cd29 ebf4 ...!..x..).. 

Unassembled:

 START: B4 01 MOV AH, 1 ; DOS read char from STDIN CD 21 INT 21H ; put char in AL F7 D9 NEG CX ; toggle CX sign 78 F8 JS START ; if negative, loop to next char CD 29 INT 29H ; DOS write char to screen again EB F1 JMP START ; loop until break/^C 

A standalone executable DOS program. Input via STDIN (pipe or keyboard interactive), output to STDOUT.

Output:

enter image description here

#x86-16 machine code, IBM PC DOS, 14 12 bytes

Binary:

00000000: b401 cd21 f7d9 78f8 cd29 ebf4 ...!..x..).. 

Unassembled:

 START: B4 01 MOV AH, 1 ; DOS read char from STDIN CD 21 INT 21H ; put char in AL F7 D9 NEG CX ; toggle CX sign 78 F8 JS START ; if negative, loop to next char CD 29 INT 29H ; DOS write char to screen again EB F1 JMP START ; loop until break/^C 

A standalone executable DOS program. Input via STDIN (pipe or keyboard interactive), output to STDOUT.

Output:

enter image description here

x86-16 machine code, IBM PC DOS, 14 12 bytes

Binary:

00000000: b401 cd21 f7d9 78f8 cd29 ebf4 ...!..x..).. 

Unassembled:

 START: B4 01 MOV AH, 1 ; DOS read char from STDIN CD 21 INT 21H ; put char in AL F7 D9 NEG CX ; toggle CX sign 78 F8 JS START ; if negative, loop to next char CD 29 INT 29H ; DOS write char to screen again EB F1 JMP START ; loop until break/^C 

A standalone executable DOS program. Input via STDIN (pipe or keyboard interactive), output to STDOUT.

Output:

enter image description here

-2 bytes, use INT 29 for output
Source Link
640KB
  • 12.4k
  • 2
  • 38
  • 61

#x86-16 machine code, IBM PC DOS, 1414 12 bytes

Binary:

00000000: b401 cd21 f7d9 78f8 b40ecd29 cd10ebf4 ebf2  ...!..x.....).. 

Unassembled:

 START: B4 01 MOV AH, 1 ; DOS read char from STDIN CD 21 INT 21H ; put char in AL F7 D9 NEG CX ; toggle CX sign 78 F8 JS START ; if negative, loop to next char B4 0E  MOV AH, 0EH ; BIOS write char to console CD 1029 INT 10H29H ; DOS write char to screen again EB F1 JMP START ; loop until break/^C 

A standalone executable DOS program. Input via STDIN (pipe or keyboard interactive), output to STDOUT.

Output:

enter image description here

#x86-16 machine code, IBM PC DOS, 14 bytes

Binary:

00000000: b401 cd21 f7d9 78f8 b40e cd10 ebf2 ...!..x....... 

Unassembled:

 START: B4 01 MOV AH, 1 ; DOS read char from STDIN CD 21 INT 21H ; put char in AL F7 D9 NEG CX ; toggle CX sign 78 F8 JS START ; if negative, loop to next char B4 0E  MOV AH, 0EH ; BIOS write char to console CD 10 INT 10H ; write char to screen again EB F1 JMP START ; loop until break/^C 

A standalone executable DOS program. Input via STDIN (pipe or keyboard interactive), output to STDOUT.

Output:

enter image description here

#x86-16 machine code, IBM PC DOS, 14 12 bytes

Binary:

00000000: b401 cd21 f7d9 78f8 cd29 ebf4   ...!..x..).. 

Unassembled:

 START: B4 01 MOV AH, 1 ; DOS read char from STDIN CD 21 INT 21H ; put char in AL F7 D9 NEG CX ; toggle CX sign 78 F8 JS START ; if negative, loop to next char CD 29 INT 29H ; DOS write char to screen again EB F1 JMP START ; loop until break/^C 

A standalone executable DOS program. Input via STDIN (pipe or keyboard interactive), output to STDOUT.

Output:

enter image description here

Source Link
640KB
  • 12.4k
  • 2
  • 38
  • 61

#x86-16 machine code, IBM PC DOS, 14 bytes

Binary:

00000000: b401 cd21 f7d9 78f8 b40e cd10 ebf2 ...!..x....... 

Unassembled:

 START: B4 01 MOV AH, 1 ; DOS read char from STDIN CD 21 INT 21H ; put char in AL F7 D9 NEG CX ; toggle CX sign 78 F8 JS START ; if negative, loop to next char B4 0E MOV AH, 0EH ; BIOS write char to console CD 10 INT 10H ; write char to screen again EB F1 JMP START ; loop until break/^C 

A standalone executable DOS program. Input via STDIN (pipe or keyboard interactive), output to STDOUT.

Output:

enter image description here