user10927965
user10927965

Reputation:

Why does this code shoot a line too long error?

I have typed this code for simulating an up-down counter using arm. It shoots line too long errors.

I only know that the error is on line 90 and 91 but i don't know how to fix it. I am running the program on DOSBox (Masm 8086). In the code below , init8255 is a macro where the 8255 is initialised. msg1 is in .data which asks for the user input [1) upcount 2)downcount]. getchar is a macro which will get a character from the user [MOV AH,1 INT 21H]

.code
mov ax,@data
mov ds,ax
init8255

;printf msg1
getchar
cmp al,1
je upcount
cmp al,2
je downcount

exit

upcount:
mov al,00h
again: outpa
call delay
call keyhit
add al,1
daa
cmp al,99h
jne again
exit

downcount:
mov al,99h
again2: outpa
call delay
call keyhit
sub al,1
das
cmp al,00h
jne again2
exit

delay proc
mov bx,0fffh
out1:mov cx,55ffh
in1:loop in1
dec bx
jnz out1
ret
delay endp

keyhit proc
 push ax ;save your precious ax value
 mov ah,1 ;checks if any key is pressed in between the count
 int 16h ;if you press any key, it becomes non-zero. so go
 jnz done to done and exit.

 pop ax ;if you don't press any key, it becomes zero. so
 take out your precious value and return.
 ret 
done:
 exit ;so you have pressed a key, go to exit.

keyhit endp
    ;line 90                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
end ;line 91

updown.asm(90) error:A2106 line too long

updown.asm(91) error:A2106 line too long

the line numbers are specified above in the code(the last two lines) Thanks in advance

Upvotes: 0

Views: 1372

Answers (1)

domen
domen

Reputation: 1908

Just selecting your code with a mouse shows me there are a lot of spaces in line 90. The scrollbar at the bottom also makes one think something is a bit odd.

This post is a perfect example how code needs to be copy pasted (and not copied by hand) for us to see what's going on.

Upvotes: 3

Related Questions