mirror of
https://github.com/byteworksinc/ORCALib.git
synced 2025-02-07 04:30:31 +00:00
Make system(NULL) detect whether a command processor is available.
Previously, it just ran an Execute shell call with NULL as the command-line pointer. The fix is to still call Execute, but with an empty string as the command line, and then check if the call gave an error. If running under plain GS/OS, this gives an error for an unknown system call, whereas both ORCA/APW and GNO shells will return with no error in this case. (Golden Gate doesn't implement the Execute shell call, so it also gives an error and will report no command processor available.) This fixes issue #25.
This commit is contained in:
parent
21d34a30ce
commit
7abdfc9beb
18
stdlib.asm
18
stdlib.asm
@ -973,14 +973,28 @@ system start
|
||||
sta exComm
|
||||
pla
|
||||
sta exComm+2
|
||||
phy execute the command
|
||||
ora exComm
|
||||
sta empty
|
||||
bne lb1 if calling system(NULL)
|
||||
lda #empty use empty command string
|
||||
sta exComm
|
||||
lda #^empty
|
||||
sta exComm+2
|
||||
lb1 phy execute the command
|
||||
phx
|
||||
plb
|
||||
Execute ex
|
||||
rtl
|
||||
ldy empty
|
||||
bne ret if doing system(NULL)
|
||||
tya
|
||||
bcs ret error => no command processor
|
||||
inc a (& vice versa)
|
||||
ret rtl
|
||||
|
||||
ex dc i'$8000'
|
||||
exComm ds 4
|
||||
|
||||
empty ds 2
|
||||
end
|
||||
|
||||
****************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user