Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; --------------------------------------------------------------
- CLO ; Close unwanted windows.
- MOV AL,1 ; -->
- PUSH AL ; Push end flag to stack to prevent stack underflow
- Rep:
- IN 00 ; Wait for key press - Store it in AL.
- PUSH AL ; Push character to stack
- CMP AL,0D ; Was it the Enter key? (ASCII 0D)
- JNZ Rep ; No - jump back. Yes - continue.
- MOV DL,C0 ; Initilize counter
- POP AL ; Remove enter key from stack
- OUTP:
- POP AL ; Pop last value from stack to AL
- CMP AL,1 ; Is it 1 (end flag)?
- JZ BYE ; Yes - end. No - continue
- MOV [DL],AL ; Move character to VDU memory
- INC DL ; Increment counter
- JMP OUTP ; Output loop
- BYE:
- END
- ; --------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment