| | |
Please Correct My Code ( Small Model )
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: May 2009
Posts: 5
Reputation:
Solved Threads: 0
Hello Programmers
This Is My Question & the answer
But .. The out put not exist
i don't know what is the wrong with it
Write a program that will take as an input 5 Capital Letters and then display on next line in small letters and in reverse order.
• Use Logical operator to convert the capital letters to small letters.
• Save the input capital letters in an array named LETTERS.
• Use only indexed addressing mode.
My Answer :
Correct it please , & that is very Kind of you
This Is My Question & the answer
But .. The out put not exist
i don't know what is the wrong with it
Write a program that will take as an input 5 Capital Letters and then display on next line in small letters and in reverse order.
• Use Logical operator to convert the capital letters to small letters.
• Save the input capital letters in an array named LETTERS.
• Use only indexed addressing mode.
My Answer :
Assembly Syntax (Toggle Plain Text)
.MODEL SMALL .STACK 100H .DATA CR EQU 0DH ;Carriage Return LF EQU 0AH ;Line Feed MSG1 DB CR,LF,'Please Enter Capital letters: $' MSG2 DB CR,LF,'Small Letters in reverse order: $' LETTERS DB ? .CODE MAIN PROC MOV AX,@DATA ;get data segment MOV DS,AX ;initialize DS ;Display MSG1 LEA DX,MSG1 ;load address of MSG1 message MOV AH,9 ;select string output INT 21H ;output MSG ;Read the input from the user AND LETTERS,0H MOV AH,1 MOV CL,5 WHILE_: INT 21H MOV LETTERS,AL DEC CL JCXZ PRO_ CMP AL,0DH JNE WHILE_ PRO_: XOR SI,SI ARR: CMP LETTERS[SI],' ' JE NEXT XOR LETTERS[SI],0DFH NEXT: DEC SI LOOP ARR ;Display MSG2 LEA DX,MSG2 ;load address of MSG2 message MOV AH,9 ;select string output INT 21H ;output MSG MOV AH,9 LEA SI,LETTERS READ: INT 21H ADD SI,2 ; IN CASE IT IS 2 LOOP READ EXIT: MOV AH,4CH ;DOS exit INT 21H MAIN ENDP ;ENDP ends a procedure END MAIN ;END ends the source program
Correct it please , & that is very Kind of you
•
•
Join Date: Apr 2009
Posts: 39
Reputation:
Solved Threads: 5
•
•
•
•
The OutPut Should Be :
Please Enter Capital letters: ABCDE
Small Letters in reverse order: edcba
20h
You know the difference between the binary of an upper and lower case character?
1 bit.
Consider the following
E - 01000101
e - 01100101
A - 1000001
a - 1100001
•
•
Join Date: Apr 2009
Posts: 39
Reputation:
Solved Threads: 5
•
•
•
•
I know that , but i dont know how to make the loop in reverse order.
ABCDEF
You access the 'A' via base address + 0 so you access the F via base address + 5
Then we load up our new array.
so...
new_array+0 = (user_input+5 with altered bit)
![]() |
Similar Threads
- The most famous CSS web sites galleries in the world (HTML and CSS)
- JSP database connectivity according to Model View Controller (MVC) Model 2 (JSP)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- Help on Emu8086 calculating Sum (Assembly)
- What is wrong with my program? (Assembly)
- How to Know that code is correct in Textpad? (Assembly)
- Mr (Assembly)
- Passing a filestream, how? (C++)
Other Threads in the Assembly Forum
- Previous Thread: Compilation error
- Next Thread: assembly language help
| Thread Tools | Search this Thread |






