ASSMBLY Languages
2 posters
Page 1 of 1
ASSMBLY Languages
include macro.txt
.model small
.stack
.386
.data
para_list label byte
max_len db 30
act_len db ?
kb_data db 30 dup (' ')
ctr db ?
converted db 30 dup (' ')
bali db 30 dup(' ')
capi db ?
smalll db ?
answer db ?
eql db 'Palindrome!$'
noteql db 'Not Palindrome!$'
reverse db 30 dup (' ')
str1 db 'Input a String: $'
cont db "Want to try Again?[y/n]: $"
.code
act8 proc far
start9a:
initz
public act8
clrscr 0e0h
gotoxy 2,7
mov ah,09
lea dx,str1
int 21h
mov ah,0ah
lea dx,para_list
int 21h
mov al,'$'
movzx si,act_len
lea bx,kb_data
mov [bx+si],al
printf kb_data
lea si,kb_data
lea di,converted
mov bl,act_len
inc bl
movzx cx,bl
mov capi,65
mov smalll,97
character:
lodsb
call convert9
stosb
loop character
call balhin
call compare
ret
convert9 proc near
push cx
mov cx,26
mov capi,65
capital:
cmp cx,0
je small2
cmp al,capi
je outna
back:
inc capi
dec cx
jmp capital
small2:
mov cx,26
mov smalll,97
small:
cmp cx,0
je outna
cmp al,smalll
je convertcapi
inc smalll
dec cx
jmp small
jmp outna
convertcapi:
sub al,20h
outna:
pop cx
ret
convert9 endp
balhin proc near
lea si,converted
movzx bx,act_len
dec bx
add si,bx
lea di,reverse
movzx cx,act_len
toink:
mov bl,[si]
mov [di],bl
dec si
inc di
loop toink
ret
balhin endp
compare proc near
lea si,converted
lea di,reverse
movzx cx,act_len
repe cmpsb
jne notpali
gotoxy 4,7
printf eql
jmp gawas
notpali:
gotoxy 4,7
printf noteql
gawas:
clear 80h,16,20,18,50
gotoxy 10,7
printf cont
mov ah,01
int 21h
cmp al,'y'
jne bm9
jmp start9a
bm9:
call main
compare endp
act8 endp
end
.model small
.stack
.386
.data
para_list label byte
max_len db 30
act_len db ?
kb_data db 30 dup (' ')
ctr db ?
converted db 30 dup (' ')
bali db 30 dup(' ')
capi db ?
smalll db ?
answer db ?
eql db 'Palindrome!$'
noteql db 'Not Palindrome!$'
reverse db 30 dup (' ')
str1 db 'Input a String: $'
cont db "Want to try Again?[y/n]: $"
.code
act8 proc far
start9a:
initz
public act8
clrscr 0e0h
gotoxy 2,7
mov ah,09
lea dx,str1
int 21h
mov ah,0ah
lea dx,para_list
int 21h
mov al,'$'
movzx si,act_len
lea bx,kb_data
mov [bx+si],al
printf kb_data
lea si,kb_data
lea di,converted
mov bl,act_len
inc bl
movzx cx,bl
mov capi,65
mov smalll,97
character:
lodsb
call convert9
stosb
loop character
call balhin
call compare
ret
convert9 proc near
push cx
mov cx,26
mov capi,65
capital:
cmp cx,0
je small2
cmp al,capi
je outna
back:
inc capi
dec cx
jmp capital
small2:
mov cx,26
mov smalll,97
small:
cmp cx,0
je outna
cmp al,smalll
je convertcapi
inc smalll
dec cx
jmp small
jmp outna
convertcapi:
sub al,20h
outna:
pop cx
ret
convert9 endp
balhin proc near
lea si,converted
movzx bx,act_len
dec bx
add si,bx
lea di,reverse
movzx cx,act_len
toink:
mov bl,[si]
mov [di],bl
dec si
inc di
loop toink
ret
balhin endp
compare proc near
lea si,converted
lea di,reverse
movzx cx,act_len
repe cmpsb
jne notpali
gotoxy 4,7
printf eql
jmp gawas
notpali:
gotoxy 4,7
printf noteql
gawas:
clear 80h,16,20,18,50
gotoxy 10,7
printf cont
mov ah,01
int 21h
cmp al,'y'
jne bm9
jmp start9a
bm9:
call main
compare endp
act8 endp
end
vampscalling- DPC Member
-
Posts : 31
Age : 33
Joined date : 2009-11-19
Location : Cebu City
Cash : 27454
Similar topics
» ASSMBLY Languages
» ASSMBLY Languages
» ASSMBLY Languages
» ASSMBLY Languages
» Languages You Can Speak/Understand
» ASSMBLY Languages
» ASSMBLY Languages
» ASSMBLY Languages
» Languages You Can Speak/Understand
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum