Re: Detect a C128 from C64 mode

From: J.G.Harston <jgh_at_mdfs.net>
Date: Mon, 20 May 2013 22:35:07 +0100
Message-ID: <d4e7f0d2feac48ccb384a68ed357dcdc@mdfs.net>
silverdr wrote:
> Any ideas to shorten it, keeping the same functionality?

Returns P=EQ/NE, A corrupted:

> c128_check:
> 	lda $d030     -    lda $d030
> 	cmp #$ff      -    cmp #$ff
> 	beq c64       -
> 	bne done_c128 -    bne done_c128
>                     - c64:
>                     -    lda #$fc
>      	              -    sta $d030
> 	              -    eor $d030
> 	              -    beq c128
>                     - done_c64:
> 	              -    lda #$00  ; set EQ
> 	              -    rts       ; EQ=c64
> c128:               - c128:
> 	lda #$ff      -    lda #$ff  ; set NE
> 	sta $d030     -    sta $d030
> done_c128:          - done_c128:   ; on entry here, already NE
> 	lda #$01      -              ; if you want A=return value, put lda 
> #$ff here
> 	rts           -    rts       ; NE=c128
> c64:                -
>       lda #$fc      -
>      	sta $d030     -
> 	eor $d030     -
> 	beq c128      -
> done_c64:           -
> 	lda #$00      -
> 	rts           -

JGH


       Message was sent through the cbm-hackers mailing list
Received on 2013-05-20 22:00:02

Archive generated by hypermail 2.2.0.