mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 19:29:45 +00:00
Protect random counter against ProDOS.
Although documented nowhere (!!!) ProDOS trashes the random counter locations $4E/$4F. Is discovered this because my TCP connections didn't have random local ports. It's a really funny coincidence that David Finnigan discovered only 3 years ago the very same issue because of the very same reason: https://groups.google.com/forum/#!topic/comp.sys.apple2.programmer/1ciep_Oetvo
This commit is contained in:
parent
cddc4da3bb
commit
a9a102b0e8
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
.import __dos_type
|
.import __dos_type
|
||||||
|
|
||||||
|
.include "apple2.inc"
|
||||||
.include "mli.inc"
|
.include "mli.inc"
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
@ -23,10 +24,24 @@ callmli:
|
|||||||
lda __dos_type
|
lda __dos_type
|
||||||
beq oserr
|
beq oserr
|
||||||
|
|
||||||
; Call MLI and return
|
; Save random counter
|
||||||
|
lda RNDL
|
||||||
|
pha
|
||||||
|
lda RNDH
|
||||||
|
pha
|
||||||
|
|
||||||
|
; Call MLI
|
||||||
jsr $BF00 ; MLI call entry point
|
jsr $BF00 ; MLI call entry point
|
||||||
call: .byte $00
|
call: .byte $00
|
||||||
.addr mliparam
|
.addr mliparam
|
||||||
|
|
||||||
|
; Restore random counter and return
|
||||||
|
tax
|
||||||
|
pla
|
||||||
|
sta RNDH
|
||||||
|
pla
|
||||||
|
sta RNDL
|
||||||
|
txa
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; Load oserror code and return
|
; Load oserror code and return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user