mirror of
https://github.com/nathanriggs/AppleIIAsm-Collection.git
synced 2024-12-02 12:52:03 +00:00
c8cac53c5e
Massive updates that changes the way most subroutines are handled. Major bugfixes, various utilities added, started higher-level libraries.
76 lines
1.9 KiB
Plaintext
76 lines
1.9 KiB
Plaintext
*
|
|
*``````````````````````````````*
|
|
* SINPUT :: SPECIAL INPUT *
|
|
* *
|
|
* INPUTS A STRING OF TEXT VIA *
|
|
* MONITOR HOOKS. MAX 255 CHARS *
|
|
*- -*
|
|
* CLOBBERS: *
|
|
* *
|
|
* FLAGS: ???----- REG: AXYM *
|
|
*- -*
|
|
* CYCLES: ??? *
|
|
* SIZE: *
|
|
*- -*
|
|
* USAGE: *
|
|
* JSR SINPUT *
|
|
*- -*
|
|
* ENTRY *
|
|
* *
|
|
* TOP OF STACK *
|
|
* *
|
|
* LOW BYTE OF RETURN ADDRESS *
|
|
* HI BYTE OF RETURN ADDRESS *
|
|
* LOW BYTE OF INPUT ADDRESS *
|
|
* HI BYTE OF INPUT ADDRESS *
|
|
*- -*
|
|
* EXIT *
|
|
* *
|
|
* TOP OF STACK *
|
|
* *
|
|
* LOW BYTE OF RETURN ADDRESS *
|
|
* HI BYTE OF RETURN ADDRESS *
|
|
* *
|
|
* A = LOW BYTE OF ADDRESS *
|
|
* X = LENGTH OF STRING *
|
|
* Y = LENGTH OF STRING *
|
|
* *
|
|
* [RETURN] = STRING TYPED *
|
|
* [RETLEN] = LENGTH OF STRING *
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
*
|
|
SINPUT
|
|
*
|
|
** SAVE RETURN ADDRESS
|
|
*
|
|
LDX #$00
|
|
JSR GETLN
|
|
STX :STRLEN ; STORE STR LENGTH
|
|
CPX #0
|
|
BEQ :ZEXIT
|
|
*
|
|
:INP_CLR
|
|
LDY #0
|
|
LDA :STRLEN ; LENGTH OF STRING
|
|
STA RETLEN ; PUT LENGTH + 1 HERE
|
|
STA RETURN ; STRING LENGTH FIRST BYTE
|
|
INC RETLEN
|
|
:LOOP
|
|
LDA KEYBUFF,Y ; PUT STR INTO NEW LOC
|
|
INY
|
|
STA RETURN,Y
|
|
CPY :STRLEN ; IF Y < STR LENGTH
|
|
BNE :LOOP ; LOOP; ELSE, CONTINUE
|
|
JMP :EXIT
|
|
:ZEXIT
|
|
LDA #0
|
|
STA RETLEN
|
|
STA RETURN
|
|
:EXIT
|
|
RTS
|
|
*
|
|
** DATA
|
|
*
|
|
:STRLEN DS 1
|
|
*
|