melikaonline
پنج شنبه 16 آبان 1387, 18:25 عصر
:ناراحت:این برنامه در اجرا خطا می دهد و اجرا نمی شود. مشکلش چیست؟
; multi-segment executable file template.
; flat assembler syntax
format MZ
entry code_seg:start ; set entry point
stack 256
segment data_seg
; add your data here!
COUNT EQU 05
DATA1 DB 100,200,150,50,20
ORG 10H
SUM DW ?
pkey db "press any key...$"
segment code_seg
start:
; set segment registers:
mov ax, data_seg
mov ds, ax
mov es, ax
; add your code here
MOV CX,COUNT
MOV SI,OFFSET DATA1
MOV AX,0
BACK1: ADD AL,[SI]
JNC OVER
INC AH
OVER: INC SI
DEC CX
JNZ BACK1
MOV SUM,AX
mov dx, pkey
mov ah, 9
int 21h ; output string at ds:dx
; wait for any key....
mov ah, 1
int 21h
mov ax, 4c00h ; exit to operating system.
int 21h
از شما بخاطر دیدن این تاپیک متشکرم.
; multi-segment executable file template.
; flat assembler syntax
format MZ
entry code_seg:start ; set entry point
stack 256
segment data_seg
; add your data here!
COUNT EQU 05
DATA1 DB 100,200,150,50,20
ORG 10H
SUM DW ?
pkey db "press any key...$"
segment code_seg
start:
; set segment registers:
mov ax, data_seg
mov ds, ax
mov es, ax
; add your code here
MOV CX,COUNT
MOV SI,OFFSET DATA1
MOV AX,0
BACK1: ADD AL,[SI]
JNC OVER
INC AH
OVER: INC SI
DEC CX
JNZ BACK1
MOV SUM,AX
mov dx, pkey
mov ah, 9
int 21h ; output string at ds:dx
; wait for any key....
mov ah, 1
int 21h
mov ax, 4c00h ; exit to operating system.
int 21h
از شما بخاطر دیدن این تاپیک متشکرم.