1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 17:29:50 +00:00
cc65/libsrc/atari/dosdetect.s
cuz 54240ffad3 Move constructor code into the INIT segment. Note: Didn't change any
obsolete modules.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3407 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-02-26 09:38:46 +00:00

56 lines
804 B
ArmAsm

;
; Freddy Offenga & Christian Groessler, June 2004
;
; detect the DOS version we're running on
;
.include "atari.inc"
.constructor detect,26
.export __dos_type
; ------------------------------------------------------------------------
; DOS type detection
.segment "INIT"
detect: lda #ATARIDOS
sta __dos_type ; set default
lda DOS
cmp #'S' ; SpartaDOS
beq spdos
cmp #'M' ; MyDOS
beq mydos
ldy #COMTAB
lda #$4C
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
sta __dos_type
rts
spdos: lda #SPARTADOS
sta __dos_type
done: rts
mydos: lda #MYDOS
sta __dos_type
rts
; ------------------------------------------------------------------------
; Data
.bss
__dos_type: .res 1