-
ORG 100h
-
-
MOV si,sp ; Save stack pointer!
-
-
input_loop:
-
XOR ax,ax
-
INT 16h ; Use int16 to get a keystroke
-
-
CMP al,' ' ; is it a space char?
-
JE input_loop ; if space, get another char
-
-
PUSH ax ; Save current char on stack top!
-
CMP al,13 ; Terminating CR?
-
JNE input_loop
-
-
POP ax ; Get rid of last pushed char (terminating CR)
-
JMP test_stack
-
-
disp_loop:
-
POP dx ; DL will get the pushed char
-
MOV ah,2
-
INT 21h
-
-
test_stack:
-
CMP si,sp ; Is the stack back where we started?
-
JNE disp_loop
-
-
done: ; So,exit
-
MOV ax,0x4C00
-
INT 0x21
No comments:
Post a Comment