Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

80x86 program, need help for modifying program

Status
Not open for further replies.

cdw2152

Newbie level 2
Joined
Apr 16, 2014
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
12
i have read the manual and instructions and cant seem to figure it out.


Instructions

Write a program using three procedures. The first should
read text from the keyboard and store it in RAM. The second
should convert any upper case characters in the stored text
to lower case. The third should display the text on the
VDU screen.

Exsisting Code that needs to be modified

THE MAIN PROGRAM
Code:
 MOV BL,70 ; [70] is the address where the text will
    ; be stored. The procedure uses this.

CALL 10 ; The procedure at [10] reads in text and
    ; places it starting from the address
    ; in BL.

   ; BL should still contain [70] here.

CALL 40 ; This procedure does nothing until you
    ; write it. It should display the text.


   ; DON'T USE END HERE BY MISTAKE.
 ; --------------------------------------------------------------
 ; A PROCEDURE TO READ IN THE TEXT
 ORG 10 ; Code starts from address [10]

PUSH AL ; Save AL onto the stack
 PUSH BL ; Save BL onto the stack
 PUSHF  ; Save the CPU flags onto the stack

Rep:
 IN 00 ; Input from port 00 (keyboard)
 CMP AL,0D ; Was key press the Enter key?
 JZ Stop ; If yes then jump to Stop
 MOV [BL],AL ; Copy keypress to RAM at position [BL]
 INC BL ; BL points to the next location.
 JMP Rep ; Jump back to get the next character

Stop:
 MOV AL,0 ; This is the NULL end marker
 MOV [BL],AL ; Copy NULL character to this position.

POPF  ; Restore flags from the stack
 POP BL ; Restore BL from the stack
 POP AL ; Restore AL from the stack

RET  ; Return from the procedure.
 ; --------------------------------------------------------------
 ; A PROCEDURE TO DISPLAY TEXT ON THE SIMULATED SCREEN
 ORG 40 ; Code starts from address [10]
    ; **** YOU MUST FILL THIS GAP ****
 RET  ; At present this procedure does
    ; nothing other than return.

; --------------------------------------------------------------
 END  ; It is correct to use END at the end.
 ; --------------------------------------------------------------
 
Last edited by a moderator:

do you know which example would relate to my problem?
 

This is what you need. Page no. 141-142.
 

Attachments

  • Program 4-2_2.txt
    3.6 KB · Views: 36
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top