Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Pep/9 subroutine below is a translation of the following recursive C function. Add appropriate comments to the five (5) bold and highlighted sections. int
The Pep/9 subroutine below is a translation of the following recursive C function. Add appropriate comments to the five (5) bold and highlighted sections. int ispalin (Char A[, int P, int Q) // Returns 1 if A[P..AIQ] is a palindrome or segment is empty // Returns 0 otherwise. if (P >= Q) return 1; if (A [P] '= A(Q)) return 0; return ispalin (A, P+1,Q-1) ispalin: ldwa 4,s cpwa 6,s brge retl ldwx 4,s ldba 2, sfx ldwx 6, s cpba 2,sfx brne ret0 subsp 8,i ldwa 10,s stwa 0,s ldwa 12, s adda 1,i stwa 2,s ldwa 14,s suba 1,i stwa 4,s call ispalin ldwa 6,s stwa 16,s addsp 8,i ret ldwa 1,i stwa 8,s ret ldwa 0,i stwa 8, s ret retl: ret0: The Pep/9 subroutine below is a translation of the following recursive C function. Add appropriate comments to the five (5) bold and highlighted sections. int ispalin (Char A[, int P, int Q) // Returns 1 if A[P..AIQ] is a palindrome or segment is empty // Returns 0 otherwise. if (P >= Q) return 1; if (A [P] '= A(Q)) return 0; return ispalin (A, P+1,Q-1) ispalin: ldwa 4,s cpwa 6,s brge retl ldwx 4,s ldba 2, sfx ldwx 6, s cpba 2,sfx brne ret0 subsp 8,i ldwa 10,s stwa 0,s ldwa 12, s adda 1,i stwa 2,s ldwa 14,s suba 1,i stwa 4,s call ispalin ldwa 6,s stwa 16,s addsp 8,i ret ldwa 1,i stwa 8,s ret ldwa 0,i stwa 8, s ret retl: ret0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started