Hi, I need to code a routine that will load up to 65535 (FFFFh) bytes into memory location pointed by ES:BX. The problem that I'm facing is that I will have to change both ES and BX depending on their values. If ES=0000h and BX=4000h and I want to load FFFFh bytes then I have to modify ES when BX wraps around, but if I only want to load 1000h then I'll be ok if I only increase BX. Is there any addressing mode that will do this for me? or do I have to implement this kind of logic?
This code only works if BX wont wrap around.
This code only works if BX wont wrap around.
Code:
mov ax, 0
mov es, ax
mov bx, 04000h
mov cx, 0ffffh
mov al, 055h
load_mem:
mov es:[bx], al
inc bx
dec cx
jnz load_mem