I'm working on emulator, which should emulated specific program. I have COM file and source file. Now I need to emulate this specific instruction (this is what I can see in DosBox debugger):
mov cl, [017B] 8A 0E 7B 01
I know it means to move value from DS (data segment) with offset 017B into CL register. But what should be in DS?
Program I'm trying to emulate (source file):
.386p
.model tiny
code segment use16
assume cs:code
org 100h
begin:
mov ax, 3h
int 10h
...
mov cl, byte ptr ds:[keylen] <-- This is the instruction I'm talking about
...
int 20h
keylen db 13
key1 db 20h, 3ah, 23h, 32h, 0bh, 3dh, 1fh, 13h, 4ch, 19h, 05h, 07h, 07h, 00h
key2 db 00h, 0ah, 11h, 08h, 03h, 1dh, 1ah, 08h, 04h, 2ch, 3fh, 33h, 1ah, 41h
key3 db 01h, 00h, 08h, 0bh, 0ch, 07h, 0ah, 05h, 02h, 09h, 06h, 03h, 04h, 00h
code ends
end begin
What should I save into DS when I start my program? Only think I'm doing now is to set DS = CS = ES = SS = SPECIFIC_ADDRESS
cs:0000-cs:00FFrange).