mirror of
https://github.com/nathanriggs/AppleIIAsm-Collection.git
synced 2024-12-12 01:30:00 +00:00
79 lines
1.9 KiB
Plaintext
79 lines
1.9 KiB
Plaintext
|
*
|
||
|
*``````````````````````````````*
|
||
|
* CMD :: EXECUTE DOS COMMAND *
|
||
|
*- -*
|
||
|
* EXECUTES A DOS COMMAND THAT *
|
||
|
* IS PASSED VIA AN ASC THAT *
|
||
|
* FOLLOWS THE JSR TO THE *
|
||
|
* ROUTINE. *
|
||
|
*- -*
|
||
|
* CLOBBERS: *
|
||
|
* *
|
||
|
* FLAGS: ????---- REG: AXYM *
|
||
|
*- -*
|
||
|
* CYCLES: ??? *
|
||
|
* SIZE: *
|
||
|
*- -*
|
||
|
* USAGE: *
|
||
|
* *
|
||
|
* JSR CMD *
|
||
|
* ASC "CATALOG" *
|
||
|
* HEX 8D00 *
|
||
|
*- -*
|
||
|
* ENTRY *
|
||
|
* *
|
||
|
* TOP OF STACK *
|
||
|
* *
|
||
|
* LOW BYTE OF RETURN ADDRESS *
|
||
|
* HI BYTE OF RETURN ADDRESS *
|
||
|
*- -*
|
||
|
* EXIT *
|
||
|
* *
|
||
|
* TOP OF STACK *
|
||
|
* *
|
||
|
* LOW BYTE OF RETURN ADDRESS *
|
||
|
* HI BYTE OF RETURN ADDRESS *
|
||
|
* *
|
||
|
* Y = CLOBBERED *
|
||
|
* X = UNCHANGED *
|
||
|
* A = UNCHANGED *
|
||
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
||
|
*
|
||
|
*
|
||
|
CMD
|
||
|
*
|
||
|
** GET RETURN ADDRESS
|
||
|
*
|
||
|
PLA
|
||
|
STA RETADR
|
||
|
PLA
|
||
|
STA RETADR+1
|
||
|
*
|
||
|
LDA #$8D
|
||
|
JSR FCOUT
|
||
|
LDA #$84 ; CTRL-D
|
||
|
JSR FCOUT
|
||
|
*
|
||
|
** NOW SEND STRING TO COUT
|
||
|
*
|
||
|
LDY #$01 ; POINT TO NEXT INSTR
|
||
|
:LP
|
||
|
LDA (RETADR),Y
|
||
|
BEQ :DONE
|
||
|
JSR FCOUT
|
||
|
INY
|
||
|
BNE :LP
|
||
|
:DONE
|
||
|
CLC ; RESTORE INSTR POINTER
|
||
|
TYA
|
||
|
ADC RETADR
|
||
|
STA RETADR
|
||
|
LDA RETADR+1
|
||
|
ADC #$00
|
||
|
PHA
|
||
|
LDA RETADR
|
||
|
PHA
|
||
|
*
|
||
|
RTS
|
||
|
*
|