r2_irooni
Registered User
سلام دوستان
من یه برنامه با زبان اسمبلی نوشتم نمیدونستم کجا سوالم رو مطرح کنم
وقتی کامپایل میکنم syntax error میده
و البته نمیدونم چطوری باید از برنامه فایل exe بگیرم
میشه کمکم کنید؟
من یه برنامه با زبان اسمبلی نوشتم نمیدونستم کجا سوالم رو مطرح کنم
وقتی کامپایل میکنم syntax error میده
و البته نمیدونم چطوری باید از برنامه فایل exe بگیرم
میشه کمکم کنید؟
کد:
;produc by reza mohebiyan & javad abdi
.model small
.stack 64
.data
i db 0
return_X db ?
return_Y db ?
text db 82 dup(' '),'$'
spac db 79 dup(' '),'$'
BSx db ?
BSy db ?
space db ?
y db ?
first_char db 0
last_char db 0
help db "f1=Save$"
.code
main proc
mov ax,@data
mov ds,ax
mov ah,2h
mov bh,0
mov dx,0000h
int 10h
mov ah,06h
mov bh,10011110b
mov cx,0000h
mov dh,00h
mov dl,79
mov al,1
int 10h
mov ah,09h
mov dx,offset help
int 21h
call C1
mov ah,4ch
int 21h
main endp
C1 proc
call menu
mov ah,2h
mov bh,0
mov dx,0100h
int 10h
for:
mov ah,00h
int 16h
cmp al,0
jne print
cmp ah,83
jne Array_label
call Delete
jmp for
Array_Label:
call Array_Keys
jmp for
print:
cmp al,13
jne print1
call Enter
jmp for
print1:
cmp al,8
jne Positon_Get
call backspace1
jmp for ;later delete all end1:
positon_Get:
mov ah,03h
int 10h
cmp dl,79
jne escape
inc dh
mov ah,02h
mov dl,0
int 10h
jmp continue
escape:
cmp al,27
je end2
continue:
mov first_char,al
mov ah,03h
int 10h
mov return_x,dh
mov return_y,dl
mov bsx,dh
mov bsy,dl
mov ah,08h
int 10h
cmp al,0
je One_char
cmp al,32
je One_char
cmp dl,78 ;new add *
jne N78
mov last_char,al
mov ah,09h
mov cx,1
mov al,32
mov bh,0
mov bl,00001111b
int 10h
cmp al,0
jmp tail_next
cmp al,32
jmp tail_next ;new add *
N78: lea si,text
mov ah,02
mov dh,bsx
mov dl,bsy
mov bh,0
int 10h
insert:
mov ah,08h
int 10h
cmp al,0
je stop
cmp al,32
je stop
mov [si],al
inc si
inc dl
mov ah,02h
int 10h
cmp dl,78
jb insert
mov ah,08h
int 10h
mov last_char,al
jmp stop1
tail_next:
lea si,text
mov al,last_char
mov [si],al
inc si
inc bsx
mov bsy,0
mov dh,bsx
mov dl,0
mov ah,02h
mov bh,0
int 10h
mov first_char,0
jmp insert
stop:
mov last_char,0
stop1:
mov [si],36
mov ah,02h
mov dh,bsx
mov dl,bsy
int 10h
cmp first_char,0 ;input char
je Go
mov al,first_char
mov ah,09h
mov cx,1
mov bh,0
mov bl,00001111b
int 10h
inc dl
GO:
mov ah,02h
mov bh,0
int 10h
mov ah,09h
lea dx,text
int 21h
cmp last_char,0
je end_Shift
cmp last_char,32
je end_Shift
jmp tail_next
end_Shift:
cmp return_y,78
jb add_y
inc return_x
mov return_y,0
mov dl,0
jmp conti_Add:
add_y:
mov dl,return_y
inc dl
conti_Add:
mov ah,02h
mov dh,return_x
mov bh,0
int 10h
jmp for:
one_char:
mov al,first_char
mov ah,09h
mov cx,1
mov bh,0
mov bl,00001111b
int 10h
mov ah,02h
inc dl
int 10h
jmp for
end2:
ret
C1 endp
backspace1 proc
mov ah,03h ;cursor
mov bh,0
int 10h
cmp dl,79
jne B79
dec dl
mov ah,02h
int 10h
mov ah,02h
mov dl,32
int 21h
mov dl,77
mov ah,02h
int 10h
jmp conti
B79:
cmp dl,0
jne start
cmp dh,1
je conti
dec dh
mov dl,79
mov bh,0
mov ah,02h
int 10h
jmp conti
start:
mov BSx,dh
mov BSy,dl
lea si,text
SR:
mov ah,02h
mov bh,0
int 10h
mov ah,08h
mov bh,0
int 10h
cmp al,00h
je and2
mov [si],al
inc si
inc i
inc dl
cmp dl,79
jbe SR
and2:
cmp i,0
ja Reposition
dec dl
mov ah,2
mov dh,BSx
mov bh,0
int 10h
mov cl,dl
mov ah,02h
mov dl,32
int 21h
mov dl,cl
mov ah,2
mov dh,BSx
mov bh,0
int 10h
jmp conti
Reposition:
dec bsy
mov ah,2 ;return first Position
mov dh,BSx
mov dl,BSy
mov bh,0
int 10h
lea si,text
mov bl,i
mov bh,0
mov [si+bx],32
inc bx
mov [si+bx],'$'
lea si,text
inc i
mov cl,i
mov ch,00h
mov ah,09
lea dx,text
int 21h
mov ah,2 ;return first Position
mov dh,BSx
mov dl,BSy
mov bh,0
int 10h
mov i,0
conti:
ret
backspace1 endp
Array_Keys proc
cmp ah,75
jne array_Right
mov ah,03h
mov bh,0
int 10h
cmp dh,0
jne L_up
cmp dl,0
je Array_Exit
dec dl
mov ah,02h
mov bh,0
int 10h
jmp Array_Exit
L_up:
cmp dl,0
jne L_back
dec dh
mov dl,79
mov ah,02h
mov bh,0
int 10h
jmp Array_Exit
L_back:
dec dl
mov ah,02h
int 10h
jmp Array_Exit
array_Right:
mov bh,0
cmp ah,77
jne Array_Top: ;= later Array_Top
mov ah,03
int 10h
cmp dl,79
jne forward
inc dh
mov ah,02
mov dl,0
int 10h
jmp Array_Exit
forward:
inc dl
mov ah,02
int 10h
jmp Array_Exit
Array_Top:cmp ah,72
jne Array_Down
dec dh
mov ah,02
int 10h
jmp Array_Exit
Array_Down:
inc dh
mov ah,02
int 10h
Array_Exit:
ret
Array_Keys endp
Delete proc
mov space,0
mov bh,0
mov dl,32
mov ah,02
int 21h
mov ah,03h
int 10h
dec dl
;mov ah,02
;int 10h
mov bsx,dh
mov bsy,dl
inc dl
lea si,text
for1:
mov ah,02
int 10h
mov ah,08h
int 10h
cmp al,00h
je check
cmp al,32
je continue1
inc Space
continue1:
mov [si],al
inc si
inc dl
cmp dl,79
je check
jmp for1
check:cmp space,0
je move_Display_Top
mov [si],' '
inc si
mov [si],'$' ;36=$
mov dh,bsx
mov dl,bsy
mov ah,02
int 10h
mov ah,09
mov dx,offset text
int 21h
mov dh,bsx
mov dl,bsy
mov ah,02
int 10h
jmp Delete_Exit
move_Display_Top:
cmp bsy,0
jne tail
mov dh,bsx
mov dl,bsy
mov ah,02
int 10h
mov bh,00001111b
mov ah,06
mov al,1
mov ch,bsx
mov cl,bsy
mov dh,24
mov dl,79
int 10h
jmp Delete_Exit
tail:
mov ch,0
mov cl,79
sub cl,bsy
dec cl
mov bl,cl
mov dl,0
mov dh,bsx
inc dh
mov bh,0 ;Page Number
lea si,text
for_t:
mov ah,02h
int 10h
mov ah,08h
int 10h
mov [si],al
inc si
inc dl
loop for_t
mov [si],'$'
mov dl,bsy
dec dh
mov ah,02h
int 10h
mov ah,09h
lea dx,text
int 21h ;Print
mov dl,bl
mov dh,bsx
inc dh
lea si,text
for_t1:
mov ah,02h
int 10h
mov ah,08h
int 10h
mov [si],al
inc si
inc dl
cmp dl,79
jb for_t1
mov [si],'$'
mov bl,dh ;bl=row
mov dl,0
mov ah,02h
int 10h
lea dx,spac
mov ah,09h
int 21h
mov dh,bl
mov dl,0
mov ah,02h
int 10h
lea dx,text
mov ah,09h
int 21h
mov dh,bl
dec dh
mov dl,bsy
mov ah,02h
int 10h
Delete_Exit:
ret
Delete endp
Enter proc
mov ah,03
int 10h
mov bsx,dh
mov bsy,dl
mov ah,07h
mov ch,0
mov cl,0
mov dh,24
mov dl,79
mov al,1
mov bh,00001111b
int 10h
call menu
mov bh,0
cmp bsy,0
jne Problem
cmp bsx,0
jne problem
inc bsx
mov ah,02h
mov dh,bsx
mov dl,bsy
int 10h
jmp E_Exit
Problem:
mov dh,2 ;bl = row
cmp bsx,1
je line_Enter
inc bsx
Row:
lea si,text
mov dl,-1 ;dl = column
Column:
inc dl
cmp dl,bsy
jne E_Nxt
cmp dh,bsx
je Print_top
E_Nxt:cmp dl,79
je Print_top
mov ah,02h
int 10h
mov ah,08h
int 10h
mov [si],al
inc si
jmp Column
Print_top:
mov y,dh
mov dl,0
mov ah,02h
mov bh,0
int 10h
mov ah,09h
lea dx,spac
int 21h
mov dh,y
dec dh
mov dl,0
mov ah,02h
mov bh,0
int 10h
mov [si],36
lea dx,text
mov ah,09h
int 21h
mov dh,y
inc dh
mov ah,02
mov dl,0
mov bh,0
int 10h
cmp dh,bsx
jb row
line_Enter:
mov dl,0
mov ah,02h ;line Enter
int 10h
lea si,text
part1:
cmp dl,bsy
je Print_part1
mov ah,02h
mov bh,0
int 10h
mov ah,08
int 10h
mov [si],al
inc si
inc dl
jmp part1
Print_part1:
mov [si],36
mov y,dh
dec dh ; line up
mov dl,0
mov ah,02h
int 10h
mov ah,09h
lea dx,text
int 21h
mov dh,y
mov dl,bsy
mov ah,02h
int 10h
lea si,text
part2:
cmp dl,79
je E_Print_Part2
mov ah,08h
mov bh,0
int 10h
cmp al,00h
je E_Print_Part2
mov [si],al
inc si
inc dl
mov ah,02
mov bh,0
int 10h
jmp part2
E_print_Part2:
mov [si],36
mov ah,02
mov dl,0
mov bh,0
int 10h
mov y,dh
lea dx,spac
mov ah,09
int 21h
mov dh,y
mov ah,02
mov dl,0
mov bh,0
int 10h
lea dx,text
mov ah,09
int 21h
mov ah,02h
mov bh,0
mov dl,0
mov dh,y
int 10h
E_Exit:
ret
Enter endp
menu proc
mov ah,2h
mov bh,0
mov dx,0000h
int 10h
mov ah,06h
mov bh,11101001b ;color menu
mov cx,0000h
mov dh,00h
mov dl,79
mov al,1
int 10h
mov ah,09h
mov dx,offset help
int 21h
mov ah,06h
mov bh,00001111b
mov cx,0100h
mov dh,01h
mov dl,79
mov al,1
int 10h
ret
menu endp
Last edited: