I had been writing a program that enforces the loop instruction with indirect addressing but I need it to copy a string from source to target, reversing the character order in the process. I need to use the variables:
source BYTE "This is the source string",0
target BYTE SIZEOF source DUP('#')
After that I need to insert the following statements right after the loop to display the hexadecimal contents of the target string:
mov esi, OFFSET target : offset of variable
mov ebx, 1 : byte format
mov exc, SIZEOF target : counter
call DumpMem
so far this is all I have and what I've been following by to help me and I'm pretty sure there is some unnecessary garbage in there...
INCLUDE Irvine32.inc
.data
val1 WORD 1000h
val2 WORD 2000h
arrayB BYTE 10h,20h,30h,40h,50h
arrayW WORD 100h,200h,300h
arrayD DWORD 10000h,20000h
.code
main PROC
; in-Direct Addressing (byte array):
mov eax,offset arrayB
mov ecx, LENGTHOF arrayB ; This would give us "5"
mov bl,0
L1:add bl, [eax]
inc eax
loop L1
; Direct-Offset Addressing (word array):
; mov ax,arrayW ; AX = 100h
; mov ax,[arrayW+2] ; AX = 200h
; Direct-Offset Addressing (doubleword array):
; mov eax,arrayD ; EAX = 10000h
; mov eax,[arrayD+4] ; EAX = 20000h
; mov eax,[arrayD+TYPE arrayD] ; EAX = 20000h
exit
main ENDP
END main
So if someone knows any helpful tips or something that'd be great cuz i'm pretty stuck with this.