mirror of
https://github.com/nathanriggs/AppleIIAsm-Collection.git
synced 2024-11-30 15:49:55 +00:00
82d0e74c1a
some minor bugfixes, directory shuffling, added demo and utility disks
83 lines
1.9 KiB
Plaintext
83 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
|
|
*
|
|
PLA
|
|
STA RETADR
|
|
PLA
|
|
STA RETADR+1
|
|
*
|
|
LDX #$00
|
|
JSR GETLN
|
|
STX :STRLEN ; STORE STR LENGTH
|
|
CPX #0
|
|
BEQ :EXIT
|
|
*
|
|
:INP_CLR
|
|
LDY #0
|
|
LDA :STRLEN ; LENGTH OF STRING
|
|
STA RETLEN,Y ; PUT LENGTH
|
|
:LOOP
|
|
LDA KEYBUFF,Y ; PUT STR INTO NEW LOC
|
|
STA RETURN,Y
|
|
INY
|
|
CPY :STRLEN ; IF Y < STR LENGTH
|
|
BNE :LOOP ; LOOP; ELSE, CONTINUE
|
|
*
|
|
:EXIT
|
|
*
|
|
** RESTORE RETURN ADDRESS
|
|
*
|
|
LDA RETADR+1
|
|
PHA
|
|
LDA RETADR
|
|
PHA
|
|
*
|
|
RTS
|
|
*
|
|
** DATA
|
|
*
|
|
:STRLEN DS 1
|
|
*
|