;=================================
stacksg segment para stack 'stack'
dw 13 dup(0)
stacksg ends
;=================================
datasg segment 'data'
fldb dw 123H
datasg ends
;=================================
codesg segment 'code'
main proc far
assume cs:codesg,ds:datasg,ss:stacksg
mov ax, datasg
mov ds, ax
xor ax , ax
mov cx ,12
initial:
push ax
inc ax
loop initial
mov cx , 12
read:
pop bx
mov dl , bl
mov ah , 02H
int 21H
loop read
mov ax , 4c00H
int 21H
main endp
codesg ends
end main
It come out with error,so I use debug to trace it
-t
AX=1510 BX=0000 CX=004F DX=0000 SP=001A BP=0000 SI=0000 DI=0000
DS=14FE ES=14FE SS=150E CS=1511 IP=0003 NV UP EI PL NZ NA PO NC
1511:0003 8ED8 MOV DS,AX
-t
AX=1510 BX=0000 CX=004F DX=0000 SP=001A BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=0005 NV UP EI PL NZ NA PO NC
1511:0005 33C0 XOR AX,AX
-t
AX=0000 BX=0000 CX=004F DX=0000 SP=001A BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=0007 NV UP EI PL ZR NA PE NC
1511:0007 B90C00 MOV CX,000C
-t
AX=0000 BX=0000 CX=000C DX=0000 SP=001A BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=000A NV UP EI PL ZR NA PE NC
1511:000A 50 PUSH AX
-t
AX=0000 BX=0000 CX=000C DX=0000 SP=0018 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=000B NV UP EI PL ZR NA PE NC
1511:000B 40 INC AX
-t
AX=0001 BX=0000 CX=000C DX=0000 SP=0018 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=000C NV UP EI PL NZ NA PO NC
1511:000C E2FC LOOP 000A
-p
AX=000C BX=0000 CX=0000 DX=0000 SP=0002 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=000E NV UP DI PL NZ NA PO NC
1511:000E B90C00 MOV CX,000C
-t
AX=000C BX=0000 CX=000C DX=0000 SP=0002 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=0011 NV UP DI PL NZ NA PO NC
1511:0011 5B POP BX
-t
AX=000C BX=000B CX=000C DX=0000 SP=0004 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=0100 IP=0012 NV UP DI PL NZ NA PO CY
0100:0012 0000 ADD [BX+SI],AL DS:000B=00
-t
AX=000C BX=000B CX=000C DX=0000 SP=0004 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=0100 IP=0014 NV UP DI PL NZ NA PO CY
0100:0014 0000 ADD [BX+SI],AL DS:000B=0C
Why is there is add instruction, and the cs become 0100 ,which is out of the scope of my program?
regards,
Max
stacksg segment para stack 'stack'
dw 13 dup(0)
stacksg ends
;=================================
datasg segment 'data'
fldb dw 123H
datasg ends
;=================================
codesg segment 'code'
main proc far
assume cs:codesg,ds:datasg,ss:stacksg
mov ax, datasg
mov ds, ax
xor ax , ax
mov cx ,12
initial:
push ax
inc ax
loop initial
mov cx , 12
read:
pop bx
mov dl , bl
mov ah , 02H
int 21H
loop read
mov ax , 4c00H
int 21H
main endp
codesg ends
end main
It come out with error,so I use debug to trace it
-t
AX=1510 BX=0000 CX=004F DX=0000 SP=001A BP=0000 SI=0000 DI=0000
DS=14FE ES=14FE SS=150E CS=1511 IP=0003 NV UP EI PL NZ NA PO NC
1511:0003 8ED8 MOV DS,AX
-t
AX=1510 BX=0000 CX=004F DX=0000 SP=001A BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=0005 NV UP EI PL NZ NA PO NC
1511:0005 33C0 XOR AX,AX
-t
AX=0000 BX=0000 CX=004F DX=0000 SP=001A BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=0007 NV UP EI PL ZR NA PE NC
1511:0007 B90C00 MOV CX,000C
-t
AX=0000 BX=0000 CX=000C DX=0000 SP=001A BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=000A NV UP EI PL ZR NA PE NC
1511:000A 50 PUSH AX
-t
AX=0000 BX=0000 CX=000C DX=0000 SP=0018 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=000B NV UP EI PL ZR NA PE NC
1511:000B 40 INC AX
-t
AX=0001 BX=0000 CX=000C DX=0000 SP=0018 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=000C NV UP EI PL NZ NA PO NC
1511:000C E2FC LOOP 000A
-p
AX=000C BX=0000 CX=0000 DX=0000 SP=0002 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=000E NV UP DI PL NZ NA PO NC
1511:000E B90C00 MOV CX,000C
-t
AX=000C BX=0000 CX=000C DX=0000 SP=0002 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=1511 IP=0011 NV UP DI PL NZ NA PO NC
1511:0011 5B POP BX
-t
AX=000C BX=000B CX=000C DX=0000 SP=0004 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=0100 IP=0012 NV UP DI PL NZ NA PO CY
0100:0012 0000 ADD [BX+SI],AL DS:000B=00
-t
AX=000C BX=000B CX=000C DX=0000 SP=0004 BP=0000 SI=0000 DI=0000
DS=1510 ES=14FE SS=150E CS=0100 IP=0014 NV UP DI PL NZ NA PO CY
0100:0014 0000 ADD [BX+SI],AL DS:000B=0C
Why is there is add instruction, and the cs become 0100 ,which is out of the scope of my program?
regards,
Max