mirror of
https://github.com/nathanriggs/AppleIIAsm-Collection.git
synced 2024-11-27 12:49:27 +00:00
9f35f32f67
- massive overhaul of architecture - first round of optimizations - first draft of the technical manual for the entire library - reorganization of directory structure
49 lines
1.6 KiB
Plaintext
49 lines
1.6 KiB
Plaintext
*``````````````````````````````*
|
|
* DOSCMD (NATHAN RIGGS) *
|
|
* *
|
|
* EXECUTES A DOS COMMAND THAT *
|
|
* IS PASSED VIA A STRING ADDR *
|
|
* *
|
|
* INPUT: *
|
|
* *
|
|
* WPAR1 = STRING ADDRESS PTR *
|
|
* *
|
|
* OUTPUT: *
|
|
* *
|
|
* NONE *
|
|
* *
|
|
* DESTROY: AXYNVBDIZCMS *
|
|
* ^^^^^ ^^^ *
|
|
* *
|
|
* CYCLES: 76+ *
|
|
* SIZE: 52 BYTES *
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
*
|
|
]SLEN EQU VARTAB
|
|
]ADDR EQU WPAR1
|
|
*
|
|
DOSCMD
|
|
*
|
|
LDA #1 ; SET DOS TO APPLESOFT MODE
|
|
STA $AAB6 ; BY SWITCHING DOS LANG FLAG
|
|
STA $75+1 ; AND SETTING INDIRECT MODE
|
|
STA $33 ; NOT DIRECT MODE
|
|
LDA #$8D ; CARRIAGE RETURN
|
|
JSR FCOUT ; SEND TO COUT
|
|
LDA #$84 ; CTRL-D FOR DOS COMMAND
|
|
JSR FCOUT ; SEND TO COUT
|
|
LDY #0 ; RESET INDEX
|
|
LDA (]ADDR),Y ; GET STRING LENGTH
|
|
STA ]SLEN ; HOLD IN ]SLEN
|
|
LDY #$01 ; SET INDEX TO FIRST CHARACTER
|
|
:LP
|
|
LDA (]ADDR),Y ; LOAD CHARACTER
|
|
JSR FCOUT ; SEND TOU COUT
|
|
INY ; INCREASE INDEX
|
|
CPY ]SLEN ; IF .Y <= STRING LENGTH
|
|
BCC :LP ; THEN KEEP LOOPING
|
|
BEQ :LP
|
|
LDA #$8D ; OTHERWISE, LOAD CARRIAGE RETURN
|
|
JSR FCOUT ; AND SEND TO COUT
|
|
RTS
|