Assignment Help, Cloud Based ERP System, Microsoft NAV Certification
WELCOME !!

Please Register, ask for assignment solutions & post the solutions if you know any.

LETS START POSTING YOUR IDEAS AND THOUGHTS AND BUILD THE COMMUNITY OF EXPERTS.

Assignment Help, Cloud Based ERP System, Microsoft NAV Certification

Stock Market, Online Tutoring, Cloud Based ERP System, Microsoft Dynamics Reporting, Microsoft Nav Certification


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 8086 Assembly on 19th March 2011, 10:57 pm

Hello, firstly let me say that I hope I am posting this topic in the correct forum.

I have an assignment for university involving 8086 assembly language. I am very new to this but have had a bash at it but to no avail.
I will post the criteria of the assignment and the code I have written so far and hopefully you can help me out. I know there is alot of code missing but that is one of the problems I am facing being a beginner.

1. The program when run will clear the screen and ask the user to enter a string
(maximum of 15 characters). If more than 15 characters are entered an appropriate
error message should be displayed and the user prompted again for a string.
2. Once the string has been entered, the screen should clear and the program will then
display the menu of options available for manipulating the string. A prompt should
also appear that requests the user to choose an option.
3. Once selected the option should be performed, displaying the results and a prompt
should appear asking the user to press any key to continue.
4. The screen should clear and the menu and option prompt should appear after the
keystroke.
5. Only if the quit option is chosen should the menu not appear.
6. Note that only in the case where the user chooses to enter a new phrase should the
original data change.
_________________________________________________________________________

StartofProgram:

call ClearScreen

call PrintMenu

call UserChoice


cmp Choice, '1'
jne try_1
mov AH, 0
mov AL, 7
int 16

mov AH, 9
lea DX, Message1
int 33

call NewLine
call NewLine

mov AH, 63
mov BX, 0
mov CX, 15
lea DX, UserText
int 33
sub AX, 2
mov Length, AX
jmp StartofProgram
try_1:

cmp Choice, '2'
jne try_2
call ClearScreen
mov AH, 64
lea DX, UserText
mov CX, 15
mov BX, 1
int 33

mov AH, 9
call NewLine
lea DX, Message2
int 33

mov AH, 1
int 33

call ClearScreen

jmp StartofProgram
try_2:

cmp Choice, '3'
jne try_3
call ClearScreen
;DISPLAY STRING IN UPPERCASE
jmp StartofProgram
try_3:

cmp Choice, '4'
jne try_4
call ClearScreen
mov si, 0
mov dh, 0
loop:
mov dl, strOrig[si]
push dx
inc si
cmp si, 6
jb loop
mov si, 0
loop2:
pop dx
mov strNew[si], dl
inc si
cmp si, 6
jb loop2
jmp StartofProgram
try_4:

cmp Choice, '5'
jne try_5
call ClearScreen
;DISPLAY COUNT OF PUNCTUATION MARKS(1,.)AND SPACES
jmp StartofProgram
try_5:

cmp Choice, '6'
jne try_6
call ClearScreen
;CAESER CIPHER
jmp StartofProgram
try_6:

cmp Choice, '7'
jne try_7
;QUIT
jmp EndofProgram
try_7:

EndofProgram:
hlt

crlf db 13,10,36
strOrig db 'abcdefghijklmno'
strNew db ' '
Title db 'ASSIGNMENT MENU$'
EnterAnewString db '[1]Enter String$'
DisplayString db '[2]Display String$'
DisplayStringInUppercase db '[3]Display String in Uppercase$'
ReverseString db '[4]Reverse String$'
PunctuationCount db '[5]Display Count of Punctuation Marks(!,.)and Spaces$'
Caeser db '[6]Caeser Cipher$'
Quit db '[9]Quit$'
ListOption db 'Please choose from the list:$'


Choice DB '1','2','3','4','5','6','9'
Message1 DB 'Please Enter A String Between 0 and 15 Characters$'
Message2 DB 'Press Any Key To Continue$'
UserText DB ' $'
Length DW 15

NewLine:
lea DX, crlf
int 33
ret

UserChoice:
mov AH, 1
int 33
mov choice, AL
ret

ClearScreen:
mov AH, 0
mov AL, 7
int 16
ret

PrintMenu:
;Text 'Assignment Menu'
mov AH, 9
lea DX, Title
int 33

call NewLine
call NewLine

mov AH, 9
lea DX, EnterAnewString
int 33

call NewLine

mov AH, 9
lea DX, DisplayString
int 33

call NewLine

mov AH, 9
lea DX, DisplayStringInUppercase
int 33

call NewLine

mov AH, 9
lea DX, ReverseString
int 33

call NewLine

mov AH, 9
lea DX, PunctuationCount
int 33

call NewLine

mov AH, 9
lea DX, Caeser
int 33

call NewLine

mov AH, 9
lea DX, Quit
int 33

call NewLine
call NewLine

mov AH, 9
lea DX, ListOption
int 33

ret
_________________________________________________________________________________

I thank you for any help or guidence you can give

Smile

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

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