Movatterモバイル変換


[0]ホーム

URL:


Wayback Machine
49 captures
09 Oct 1999 - 27 Feb 2024
DecJANFeb
02
200720082009
success
fail
COLLECTED BY
Organization:Alexa Crawls
Starting in 1996,Alexa Internet has been donating their crawl data to the Internet Archive. Flowing in every day, these data are added to theWayback Machine after an embargo period.
Collection:52_crawl
this data is currently not publicly accessible.
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20080102014138/http://www.s-direktnet.de:80/homepages/k_nadj/cputest.html

risszeichnung

How to detect on which CPU the assembler code is running

(This information is fromDraco, the author ofSYSINFO 2.0)

You can test on plain 6502-Code if there is a 65c816 CPU, the 16-Bitprocessor avaible in some XLs as a turbo-board, avaible. Draco told mehow to do this:

First we make sure, whether we are running on NMOS-CPU (6502) or CMOS(65c02,65c816). I will just show the "official" way which doesn`t uses"illegal opcodes":

test_nmos: lda #$99           clc           sed           adc #$01           cld           beq cmos           ...; if the program is here we have a 6502-cpu           rtscmos       ...; if here, we have a cmos-type (65c02,65c816)           jmp test_65816

This test uses the decimal mode and the decimal addition. OnNMOS-CPUs the addition does not affect the Z-flag.

But now we have to make sure if we are running on a 16-bit-CPU. Thiscould be important if we include in our program/demo 16-bit Code oron the other side if we can use "illegal opcodes".

The 16-bit test uses the REP #$xx command which does nothing on 65c02! (but on 65c816 !!!):
test_65816: rep #$02  ; resets the Z-flag on 65c816 (use MAE-Assembler !!!)            bne c816            ...       ; here is stored the 65c02-Code            rtsc816        ...       ; here could be the additional 16-bit code            rts

Special thanx to Draco!!! I will use in my next demos/intros 16-Bitcode even if its just 16-bit additions which make life easier. ;)

back to main-index



Last changes: 19 Jun 1997

Amiga_logo

Feel free to contact me for any legal reason!


email_icon HeAvEn, Member of TaquarT
[8]ページ先頭

©2009-2026 Movatter.jp