In: Computer Science
Assembly Language
Copyable Code:
SECTION .data
input db 'Enter SHAKESPEARE and POET Strings: ', 0Ah
inputLen equ $ - input
answer db 'After Interchanging: ', 0Ah
answerLen equ $ - answer
SECTION .bss
firstMSG: resb 255 ;for shakespeare byte
secondMsg: resb 255 ;for poet byte
SECTION .text
global _start
_start:
;print input
mov edx, inputLen
mov ecx, input
mov ebx, 1
mov eax, 4
int 80h
mov edx, 255
mov ecx, firstMSG
mov ebx, 0
mov eax, 3
int 80h
mov edx, 255
mov ecx, secondMsg
mov ebx, 0
mov eax, 3
int 80h
;display the input
mov edx, answerLen
mov ecx, answer
mov ebx, 1
mov eax, 4
int 80h
mov edx, 255
mov ecx, secondMsg
mov ebx, 1
mov eax, 4
int 80h
mov edx, 255
mov ecx, firstMSG
mov ebx, 1
mov eax, 4
int 80h
mov ebx, 0
mov eax, 1
int 80h