D
D
Diffins2018-06-03 00:09:18
assembler
Diffins, 2018-06-03 00:09:18

Why is the code not assembled (turbo assembler)?

Please help me understand what is wrong with the code, why does it not want to be executed?

.CODE 
g_k proc 
mov ax,@data 
mov ds, ax 
mov es, ax 
d: lea dx, t1 
mov ah,09h 
int 21h 
lea di, x_ascii 
call ink 
call des_2 
push ax 
lea dx,t3 
mov ah,9h 
int 21h 
pop ax 
call bin_dis 
push ax 
lea dx,t4 
mov ah,9h 
int 21h 
pop ax 
call outhex 
lea dx,t5 
mov ah,9h 
int 21h 
mov ah,1h 
int 21h 
cmp al,"Y" 
loope d 
cmp al,"y" 
loop d 
mov ah,4ch 
int 21h 
g_k endp 
ink proc 

xor cx,cx 
l1: 
mov ah,1 
int 21h 
stosb 
inc cx 
cmp al,0dh 
jnz l1 
dec cx 
ret 
ink endp 
dis proc 

r1: mov dl,[di] 
mov ah,2 
int 21h 
inc di 
loop r1 
ret 
dis endp 
des_2 proc 

mov si,10 
lea di,x_ascii 
sub ax,ax 
v1: mul si 
mov bp,ax 
mov al,[di] 
sub al,48 
inc di 
mov ah,ch 
add ax,bp 
loop v1 
ret 
des_2 endp 
bin_dis proc 

lea di,buf 
mov cx,16 
mov bx,ax 
mov dx,ax 
conv: 
mov al,ch 
shl dx,1 
adc al,'0' 
stosb 
loop conv 
mov ah,9h 
lea dx,buf 
int 21h 
mov ax,bx 
ret 
bin_dis endp 

outhex: 
mov ch,al 
mov al,ah 
mov ah,2 
call prnbh 
mov al,ch 
prnbh: 
mov dh,al 
shr al,1 
shr al,1 
shr al,1 
shr al,1 
call prnd 
mov al,dh 
and al,15 
prnd: 
or al,48 
cmp al,58 
jc prnc 
add al,7 
prnc: 
mov dl,al 
int 33 
ret 

end g_k

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question