1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-26 08:32:00 +00:00
cc65/libsrc/atari/dosdetect.s
cpg ae39e1c0af recognize XDOS -- patch from Stefan Haubenthal
git-svn-id: svn://svn.cc65.org/cc65/trunk@5524 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-02-11 08:35:54 +00:00

54 lines
879 B
ArmAsm

;
; Freddy Offenga, Stefan Haubenthal, Christian Groessler, March 2007
;
; detect the DOS version we're running on
;
.include "atari.inc"
.constructor detect,26
.export __dos_type
; ------------------------------------------------------------------------
; DOS type detection
.segment "INIT"
detect: lda DOS
cmp #'S' ; SpartaDOS
beq spdos
cmp #'M' ; MyDOS
beq mydos
cmp #'X' ; XDOS
beq xdos
lda #$4C ; probably default
ldy #COMTAB
cmp (DOSVEC),y
bne done
ldy #ZCRNAME
cmp (DOSVEC),y
bne done
ldy #6 ; OS/A+ has a jmp here
cmp (DOSVEC),y
beq done
lda #OSADOS
.byte $2C ; BIT <abs>
spdos: lda #SPARTADOS
.byte $2C ; BIT <abs>
mydos: lda #MYDOS
.byte $2C ; BIT <abs>
xdos: lda #XDOS
sta __dos_type
done: rts
; ------------------------------------------------------------------------
; Data
.bss
__dos_type: .res 1 ; default to ATARIDOS