Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

8086 trainer problem

firetailfiretail Member Posts: 1
Hi!
I wrote for a simple program for complementing the content of address 0300:0 and save it in address 0300:1.

Here is my program

OUTPUT 2500AD
ORG 2000H
MOV DX,0FFE6H
MOV AX,82H
OUT DX,AL
NEXT:MOV AX,3000H
MOV BX,0000H
CALL DISP
NOT AL
MOV 3001H,AL
MOV BX,0100H
CALL DISP
JMP SHORT NEXT
DISP:PUSH AX
MOV CX,1
CALL FAR 0FF00:0B12H
POP AX
RET
END
I am using 8086 trainer kit to test it.But this program takes the 3000H as the data and shows on the data display.The result that complemented is 30FFH on address display.Can someone tell me what goes wrong in my program?
I initially load 20H as the 1 byte data in address 3000H.
Thanks!

Comments

  • m34tb34tm34tb34t Member Posts: 25
    First off 300:0 is a segment:offset style address so you need to set a segment register to access the right spot.
    Second you must use brackets [] to indicate that a number refers to memory. I might load my register with something like this:
    [code]
    mov ax,300h
    mov ds,ax ; set segment register
    xor si,si ; set to zero
    lodsb ; loads byte from ds:si (300:0) and incriments si
    not al
    mov [si],al ; notice the brackets to indicate a memory refrence
    [/code]
    You should only use the value 3000h if you have set your segment to zero instead of 300h... which is actually the same byte anyway.

    I'm not at all familiar with this "trainer kit" you mention.... but that OUT opcode is a little strange to me and your program seems to be an infinite loop....
Sign In or Register to comment.