Question: Need help fixing jump destination too far [ : by ' n ' bytes ] error in . asm. Edit code as needed code provided:

Need help fixing jump destination too far [: by 'n' bytes] error in .asm. Edit code as needed
code provided:
INCLUDE C:\Irvine\Irvine32.inc
INCLUDE C:\Irvine\Macros.inc
.data
prompt BYTE "Enter string: "
buffer BYTE 128 DUp(0)
.code
main PROC
; Prompt users
mov edx, OFFSET prompt
call WriteString
; Get string from user
mov edx, offset buffer
mov ecx, (LENGTHOF buffer -1)
call ReadString
; Save the number of characters read in
mov ecx, eax
call categorize
exit
main ENDP
; Loops through the given string, identifying the type of each character
; Receives: edx - address of buffer
; ecx - number of characters to look at (not length)
categorize PROC USES EAX ECX EDX
TOP:
mov al,[edx]
cmp al,'' ; Non-destructive SUB - sets flags but AL is unchanged
jb CONTROL ; Jump if AL is below ''
; AL >=32
cmp al,'0'
jb PUNCTUATION ; Jump if AL <'0'
cmp al,'9'
jbe DIGIT ; Jump if AL is between '0' and '9'
cmp al,'A'
jb PUNCTUATION ; Jump if AL <'A'
cmp al,'Z'
jbe LETTER ; Jump if AL is between 'A' and 'Z'
cmp al,'a'
jb PUNCTUATION ; Jump if AL <'a'
cmp al,'z'
jbe LETTER ; Jump if AL is between 'a' and 'z'
cmp al,'~'
jbe PUNCTUATION ; Jump if AL is between '{' and '~'
; AL >'~'
jmp CONTROL
DIGIT:
call WriteDec
mwrite <" is a digit character ">
call WriteChar
call CRLF
jmp BOTTOM
PUNCTUATION:
call WriteDec
mwrite <" is a punctuation character ">
call WriteChar
call CRLF
jmp BOTTOM
LETTER:
call WriteDec
mwrite <" is a letter character ">
call WriteChar
call CRLF
jmp BOTTOM
CONTROL:
call WriteDec
mwrite <" is a control character">
ret
BOTTOM:
inc edx
loop TOP
ret
categorize ENDP
END main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!