# YASM, i8086, MS-DOS, AT&T:
.code16
.text
N89465769:
pushw %cs
popw %ax
movw %ax, %ds
movw %ax, %es
movw $Prompt, %dx
movb $0x09, %ah
int $0x21
movw $Buffer, %dx
incb %ah
int $0x21
movb Len, %cl
xorb %ch, %ch
movw $String, %si
movw %cx, %di
movb $0x24, %al
addw %si, %di
stosb
Repeat:
lodsb
cmpb LetterO, %al
je Replace
cmpb LetterA, %al
jne Next
Replace:
movb LetterO, %ah
addb LetterA, %ah
subb %al, %ah
movb %ah, -1(%si)
Next:
loop Repeat
movw $Result, %dx
movb $0x09, %ah
int $0x21
movw $String, %dx
int $0x21
xorb %ah, %ah
int $0x16
movb $0x4C, %ah
int $0x21
Prompt: .ascii "Введите строку: \r\n$"
Result: .ascii "\r\nПреобразованная строка: \r\n$"
Buffer: .byte 80
Len: .space 1, 0
String: .space 80, 0
LetterO: .ascii "o"
LetterA: .ascii "a"