السلام عليكم و رحمة الله و بركاته
أخوكم في الله يطلب منكم مساعدته في ايجاد حل كامل لسؤالين في لغة الأسمبلي علما أني حاولت فيهما و لكن من دون جدوى
و السؤالين هما
1 طباعة رسالة
A) Displaying Messages
Write an assembly language program with the following specifications:
1) Create a $ terminated message at a reasonable offset in the data segement, for example the message: "Ramadan Mubarak".
2) Repeatedly display this message on the screen on a new line whenever any keyboard character, other than the character "s", is pressed.
3) Stop displaying the message when the character "s" is entered from the keyboard.
4) Terminate the program and return to DOS.
Hints:
1) Use DOS Function number 9 to display the memory message.
2) Use DOS Function number 7 or 8 to read a keyboard entered character without echoing the character to the display.
3) Use the CMP, JZ, JMP, or LOOP as needed.
4) Use DOS function number 4C to Return to DOS.
و الثاني
B) Printing Messages Using the PC's Parallel printer
Write an assembly language program with the following specifications:
1) Create a message at a reasonable offset address in the data segement, for example the message: "Ramadan Mubarak and Kulu Eam wa antum bixair".
2) Print the message on a new line by reading the message character-by-character and sending each character to the parallel printer port.
3) Position the printer on a new line after the message is printed.
4) Repeat printing the message when any keyboard character, other than "s" is pressed.
5) Stop printing and return to DOS when "s" is pressed.
6) Terminate the program and return to DOS.
Hints:
1) Write a subroutine that reads the memory message character-wise and place each character read in Al register.
2) Call the above subroutine.
3) Send the character in AL to the printer data port.
4) Before printing the next character read the printer status from the status port and check that the printer is not busy before sending it to the printer data port.
5) If the printer is busy repeatedly poll the printer or check its status.
6) When the printer is ready, start and stop printing the charcter in its data port by sending a control signal to the control port.
7) Repeat steps 2- 6 until the whole message is printed.
8) While repeating steps 2-6, listen to a key press at the start of every new line, if "s" is pressed terminate the program and return to DOS.
Use any DOS or Windows PC configuration program to find out the addresses of the parallel printer 8-bits Status, Data, and Control ports.
Find out about the bit assignments for each port.
Use the TEST instruction to test if certain bits are set to zero (this is useful in testing for the printer status). Other useful instructions are: CMP, JZ, JNZ, JMP, LOOP, IN, and OUT.
و شكرا سلفا