2021-10-28

Can't use `ORG` in emu8086

Compile the following code with emu8086, and the program will always be filling in numbers to the data segment, without executing org.

data segment 
    Count db 0AH 
    org 3500h
    StuId db 1,2,3,4,5,6,7,8,9,0   
    org 3600h
    Dest db 10 dup(0)
data ends
code segment 
    assume cs:code, ds:data
start:
    mov ax, data
    mov ds, ax
    mov cl, Count
    mov ch, 00h   
    lea si, STuId
    lea di, Dest
next:
    mov al, [si]
    mov [di], al 
    inc si
    inc di
    loop next
    mov ah, 4ch
    int 21h
code ends
    end start

When I remove org, the program executes normally, but then it can't locate within the segment.



from Recent Questions - Stack Overflow https://ift.tt/3GpkmMJ
https://ift.tt/eA8V8J

No comments:

Post a Comment