Question: How could I change this assembly code around but still arrive at the same output? The output of this is: $ ./a.out AbCdEfGhIjKlMnOpQrStUvWxYz $ Text

How could I change this assembly code around but still arrive at the same output?

How could I change this assembly code around but still arrive at

The output of this is:

$ ./a.out AbCdEfGhIjKlMnOpQrStUvWxYz $

Text version of code:

.intel_syntax noprefix

.data

n1:

.int 97

n2:

.int 122

.text

.globl main

main: mov ebx, DWORD PTR n1

loop: cmp ebx, DWORD PTR n2

jg end

cmp ebx, 97

jge ucase

add ebx, 32

mov edi, ebx

call putchar

inc ebx

jmp loop

ucase: sub ebx, 32

mov edi, ebx

call putchar

inc ebx

jmp loop

end: mov edi, 10

call putchar

mov eax, 0

ret

.intel_syntax noprefix .data 3 nl: 4 5 n2 .int 97 .int 122 7 8 .text 9 10 11 main: mov 12 loopmp 13 14 15 .globlmain ??? dge add mov call inc mp ebx, DWORD PTR nl ebx, DWORD PTR n2 end ebx, 97 ucase ebx, 32 edi, ebx putchar ebx loop 17 18 19 20 21 22 ucase sub 23 24 25 26 27 28 end: 29 30 31 mov call inc mp ebx, 32 edi, ebx putchar ebx loop mov call mov ret edi, 10 putchar eax, 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!