Dynamic Profile Codes
Would you like to react to this message? Create an account in a few clicks or log in to continue.

ASSMBLY Languages

2 posters

Go down

ASSMBLY Languages Empty ASSMBLY Languages

Post by vampscalling Thu Nov 19, 2009 9:19 pm

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
vampscalling
vampscalling
DPC Member

Male
Posts : 31
Age : 32
Joined date : 2009-11-19
Location : Cebu City
Cash : 26374

Back to top Go down

ASSMBLY Languages Empty Re: ASSMBLY Languages

Post by HAZEL Fri Mar 12, 2010 3:04 pm

i dun' understand.
HAZEL
HAZEL
DPC Elite

Female
Posts : 3699
Age : 27
Joined date : 2009-10-26
Location : DAVAO
Cash : 33420

http://neesayzel.multiply.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum