Write an ALP to search for the occurrence of a character in a given string. Use function calls for reading the character from keyboard and reading a string using buffered keyboard input.
.model small
.data
str db 80h,?,7dh dup(0)
search_char db '?'
len equ search_char-str
pos dw ?
msg db 'type in a sentence,cr, then char to be search',0dh,0ah,'$'
msg1 db 0dh,0ah,'search successful $'
msg2 db 0dh,0ah,'not successfull $'
crlf db 0dh,0ah,'$'
.code
mov ax,@data
mov ds,ax
mov es,ax
mov ah,9
lea dx,msg
int 21h
mov ah,0ah
lea dx,str
int 21h
lea di,str+2
mov cx,len-2
mov ah,9
lea dx,crlf
int 21h
mov ah,1
int 21h
mov search_char,al
repne scasb
jz get_pos
mov ah,9
mov dx,offset msg2
int 21h
jmp exit
get_pos: sub di,offset str+2
mov pos,di
mov ah,9
lea dx,msg1
int 21h
call posdisp
exit : mov ah,4ch
int 21h
posdisp proc near
mov al,byte ptr pos
and al,0f0h
mov cl,4
rol al,cl
call asc_dsp
mov al,byte ptr pos
and al,0fh
call asc_dsp
ret
asc_dsp proc near
cmp al,0ah
jb next
add al,07
next: add al,'0'
mov dl,al
mov ah,2
int 21h
ret
asc_dsp endp
posdisp endp
end
.model small
.data
str db 80h,?,7dh dup(0)
search_char db '?'
len equ search_char-str
pos dw ?
msg db 'type in a sentence,cr, then char to be search',0dh,0ah,'$'
msg1 db 0dh,0ah,'search successful $'
msg2 db 0dh,0ah,'not successfull $'
crlf db 0dh,0ah,'$'
.code
mov ax,@data
mov ds,ax
mov es,ax
mov ah,9
lea dx,msg
int 21h
mov ah,0ah
lea dx,str
int 21h
lea di,str+2
mov cx,len-2
mov ah,9
lea dx,crlf
int 21h
mov ah,1
int 21h
mov search_char,al
repne scasb
jz get_pos
mov ah,9
mov dx,offset msg2
int 21h
jmp exit
get_pos: sub di,offset str+2
mov pos,di
mov ah,9
lea dx,msg1
int 21h
call posdisp
exit : mov ah,4ch
int 21h
posdisp proc near
mov al,byte ptr pos
and al,0f0h
mov cl,4
rol al,cl
call asc_dsp
mov al,byte ptr pos
and al,0fh
call asc_dsp
ret
asc_dsp proc near
cmp al,0ah
jb next
add al,07
next: add al,'0'
mov dl,al
mov ah,2
int 21h
ret
asc_dsp endp
posdisp endp
end
When your business revenues hit the multiple six-figure+ range, business owners are typically faced with a new challenge in their business - creating new growth. Most business owners hire an Online Business Manager when they've hit the ceiling, feel frustrated, are stuck, and simply cannot grow the business anymore by being the only one in charge of everything! They realize that they must step out of being the one that is "DOING" making space to fully step into a leadership role in order to grow to 7-figures and beyond. Business Discounts In New york
ReplyDeleteBlogs on technology helps you stay updated in terms of the latest technology news, launch of gadgets, and many more. Subscribe to technology blogs and use information for your personal or professional use. http://millennialmoderator.com/how-to-write-a-job-description-that-will-attract-top-talent#fold
ReplyDeleteBuying a small business requires a tremendous amount of preparation. Successful and well managed businesses that are for sale are in short supply and a serious buyer will need to be well prepared prior to pursuing a purchase. This article outlines the process an entrepreneur should follow in such a pursuit. barclays public adjusters
ReplyDeleteThis article will provides you with the basic understanding of Business setup in Dubai. The process of business setup in Dubai involves due diligence as you have been provided with the number of options to choose from. Also in this article you will find the possible number of business types you can setup as a foreign expat. You will get the idea of the governing authority that you have to get the permission before you start your business in Dubai. Also it will put some light on the benefits you may get for specific type of business you are willing to setup in Dubai. مصور جلسات تصوير حفلات
ReplyDeleteWhen your business revenues hit the multiple six-figure+ range, business owners are typically faced with a new challenge in their business - creating new growth. Most business owners hire an Online Business Manager when they've hit the ceiling, feel frustrated, are stuck, and simply cannot grow the business anymore by being the only one in charge of everything! They realize that they must step out of being the one that is "DOING" making space to fully step into a leadership role in order to grow to 7-figures and beyond. biden
ReplyDeleteFailure is not an option, starting out on the right path is. A vast majority of business failures are a result of not knowing the simple steps you can take to steer clear of inevitable obstacles we all face as entrepreneurs. Don't start your journey in the wrong direction. Follow these simple steps towards SUCCESS! Personal assistant services
ReplyDeleteINTRODUCTION - Perhaps I should start by asking the question "What is a Home Based Business? This is any business operated from the comfort of the residential home of the owner. Business analyst jobs
ReplyDeleteLearn about the fantastic and incredible benefits of marketing your business using articles. Article marketing is considered one of the most powerful and cost-effective ways to increase your business sales and profits. Using articles you can not only increase your revenues but also be seen as an expert in your field. In addition, articles are used by savvy business owners to enhance their reputations in their communities. Read this article to learn how article marketing can help your business. Freedom Insurance
ReplyDeleteWhen your business has grown to multiple 6-7-figures, it will require that you begin to step into a CEO and Visionary role to lead your business to higher levels of growth. The business now has a life of its own and if you stay in the doing role too long, you will lose control of your vision. InstantBlue
ReplyDeleteInteresting read i think your website is great with informative content which i like to add to my bookmarks. I’d like to share everyone 안전놀이터
ReplyDeleteThe type of insurance that helps maintain a business while the primary revenue generator is convalescing is called Business Overhead Expense (BOE) Disability Insurance (DI). The probability that a person will become disabled for three months or longer is a little over 25%, which puts a business at risk of insolvency in the event the business owner cannot work. This article discusses the key reasons for purchasing BOE, what it covers, the benefits, limitations, and the factors that go into calculating a premium. DUI Attorney Vancouver WA
ReplyDeleteA laser engraving business is a very profitable business one can start from home. For someone thinking of pulling out of formal employment, laser engraving offers a great opportunity to venture into business. But is it right for you? bulk mulch
ReplyDeleteWhen your business has grown to multiple 6-7-figures, it will require that you begin to step into a CEO and Visionary role to lead your business to higher levels of growth. The business now has a life of its own and if you stay in the doing role too long, you will lose control of your vision. concealed handgun license classes texas
ReplyDeleteWhen your business has grown to multiple 6-7-figures, it will require that you begin to step into a CEO and Visionary role to lead your business to higher levels of growth. The business now has a life of its own and if you stay in the doing role too long, you will lose control of your vision. cara cek imei iphone
ReplyDelete