PDA

View Full Version : CP/M Function 10 Read Console Buffer



Mike_Z
November 23rd, 2016, 08:00 AM
I've been experimenting with the CP/M function 10 Read console buffer. Currently I want to create a 4 character input box which will accept a 4 bit hex address. I'm having trouble with the console input terminating when the input buffer overflows. I know that is the way it works, but how can I make a correction after all 4 character have been entered. This is what I have so far



MAXCHAR: EQU 04H
NUMBERCT: EQU 0H
INBUFF: DB MAXCHAR,NUMBERCT,'8000' ;default is 8000

MVI C,0AH
LXI D,INBUFF
CALL 5


The default value does not show in the display, but that is a different problem. Seems that after 4 characters are entered the function is over and the program moves on. So... I figured that I'd change the MAXCHAR to 05H and this works, unless the user enters 5 characters in a row and this jumps out of my field. How can I get this to only enter 4 characters and not terminate on overflow? Thanks Mike

I thought about jumping back to the function on overflow, but how would I recognize the difference between overflow and carriage return?

PS - My drives are working flawlessly so far. I found another Shugart 800. This new one is a 800-2 with no data separator, but I don't need it. The Shugart that I have now is a 800-1.

Chuck(G)
November 23rd, 2016, 09:57 AM
You can't, at least not using standard CP/M calls. Personally, I'd make a large buffer and then edit/check it after input. This is the way most do it.

You could, of course, do single-character I/O, handling the corrections on the fly, but that may be more trouble than it's worth.