REMINDER - Stay logged in for at least 2 hours a week to get whitelisted.
Also it helps build a picture where our "good traffic" is coming from for detection scripts.
:o)

ASM detect CPU type ?

News,announcements,programming,fixes,game patches & discussions.
User avatar
exxos
Site Admin
Site Admin
Posts: 28575
Joined: 16 Aug 2017 23:19
Location: UK

Re: ASM detect CPU type ?

Post by exxos »

mfro wrote: 08 Dec 2022 15:14 Now it depends on where "appropriate" is. You are calling a GEMDOS function now. That's supposed to fail as well until GEMDOS is fully initialised.
Dammit... So how are you supposed to draw text after the logo them because it looks like the code uses the same stuff anyway..

Code: Select all

crcmsg: dc.b 'WARNING: BAD ROM CRC IN CHIP ',0
crcmsg2 dc.b '.',13,10,0
crcfail:
        move.l    a5,d5
        pea.l     crcmsg
        move.w    #9,-(a7)
        trap      #1
        move.b    #$45,d0            /* 'E' - even */
        btst      #0,d5
        beq.s     chipE
        move.b    #$4F,d0            /* 'O' - odd */
All I am really doing is trying to output different text.. And my code is directly under that..
User avatar
mfro
Posts: 125
Joined: 13 Dec 2018 07:32

Re: ASM detect CPU type ?

Post by mfro »

exxos wrote: 08 Dec 2022 15:17
mfro wrote: 08 Dec 2022 15:14 Now it depends on where "appropriate" is. You are calling a GEMDOS function now. That's supposed to fail as well until GEMDOS is fully initialised.
Dammit... So how are you supposed to draw text after the logo them because it looks like the code uses the same stuff anyway..
Then it probably *is* appropriate. Anyway, if TOS succeeds and you fail with the apparent same call, then it's who's fault, probably? :lol:

(SCNR. But can't help you any further if you don't show surrounding code. Maybe you destroyed a register that later code depends on?)
And remember: Beethoven wrote his first symphony in C.
User avatar
exxos
Site Admin
Site Admin
Posts: 28575
Joined: 16 Aug 2017 23:19
Location: UK

Re: ASM detect CPU type ?

Post by exxos »

mfro wrote: 08 Dec 2022 15:32
Then it probably *is* appropriate. Anyway, if TOS succeeds and you fail with the apparent same call, then it's who's fault, probably? :lol:

(SCNR. But can't help you any further if you don't show surrounding code. Maybe you destroyed a register that later code depends on?)
Well here is all the code If you want to have a bash at it, it is only from TOS anyway. I was adding my code around line 1745.. I have taken it out for now because I cannot get anything but the single character code to output anything anyway.

startup.zip
You do not have the required permissions to view the files attached to this post.
User avatar
mfro
Posts: 125
Joined: 13 Dec 2018 07:32

Re: ASM detect CPU type ?

Post by mfro »

at least in your previous code post, it appears you are missing a terminating 0 byte after the string.
And remember: Beethoven wrote his first symphony in C.
User avatar
exxos
Site Admin
Site Admin
Posts: 28575
Joined: 16 Aug 2017 23:19
Location: UK

Re: ASM detect CPU type ?

Post by exxos »

mfro wrote: 08 Dec 2022 16:11 at least in your previous code post, it appears you are missing a terminating 0 byte after the string.
ohhhhhh

Capture.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
mfro
Posts: 125
Joined: 13 Dec 2018 07:32

Re: ASM detect CPU type ?

Post by mfro »

exxos wrote: 08 Dec 2022 16:23 ohhhhhh
Good start. At least the string is there. And TOS is still able to properly throw bombs, so you probably didn't do too much damage ;)

GEMDOS calls trash registers D0,D1 and A0-A2. If the surrounding code requires it, you'll have to save and restore these.
And remember: Beethoven wrote his first symphony in C.
User avatar
exxos
Site Admin
Site Admin
Posts: 28575
Joined: 16 Aug 2017 23:19
Location: UK

Re: ASM detect CPU type ?

Post by exxos »

mfro wrote: 08 Dec 2022 16:53 Good start. At least the string is there. And TOS is still able to properly throw bombs, so you probably didn't do too much damage ;)
:D
mfro wrote: 08 Dec 2022 16:53 GEMDOS calls trash registers D0,D1 and A0-A2. If the surrounding code requires it, you'll have to save and restore these.
Currently trying to figure out a comparison..

Code: Select all

	move.l		$59e.w,a0
	move.l		#0,d0
	cmp.l		a0,d0

but geez, I have not done assembly since like 1994 and that was with the Z80 :lol:

Instructions says it affects flags but I'm not sure how you supposed to check the result. If I remember rightly there was something where it would skip the next instruction on a comparison or something like that :shrug:

By all accounts it a short stack frame which is zero, and I need to check for that and output the message saying "hello world" :lol:
czietz
Posts: 586
Joined: 14 Jan 2018 13:02

Re: ASM detect CPU type ?

Post by czietz »

Perhaps the bombs are due to the absence of a boot device. (No floppy drive configured, maybe?) EDIT: Then again, Hatari has a built-in debugger, so it should be easy to find out where and why it bombs.

Hmm... If only there was an open-source, actively developed OS written in a higher level language than assembler, which users could modify as much as they like (as long as they follow the GPL terms) by adding C code... Hmm... :lol:
User avatar
exxos
Site Admin
Site Admin
Posts: 28575
Joined: 16 Aug 2017 23:19
Location: UK

Re: ASM detect CPU type ?

Post by exxos »

czietz wrote: 08 Dec 2022 16:58 Perhaps the bombs are due to the absence of a boot device. (No floppy drive configured, maybe?)
The bombs are expected because it is running a 68000 CPU on a 030 build of TOS. Hence trying to construct a routine which handles this more elegantly.
czietz wrote: 08 Dec 2022 16:58 Hmm... If only there was an open-source, actively developed OS written in a higher level language than assembler, which users could modify as much as they like (as long as they follow the GPL terms) by adding C code... Hmm... :lol:
Yeah shame :lol: Though I think I hate C code more than assembler. I was actually pretty good at assembly back in the day, while on the Z80 and even did some bits on the ST as well back in early 90s. was pretty good at PIC assembler as well more recently. But C code, nope, never touch the stuff.

I'm only playing about really at the end of the day, not looking to rewrite a whole operating system :)
User avatar
exxos
Site Admin
Site Admin
Posts: 28575
Joined: 16 Aug 2017 23:19
Location: UK

Re: ASM detect CPU type ?

Post by exxos »

So this seems to be causing it to crash even just by itself :shrug:

Code: Select all

infoText:  dc.b 'Hello World',0

Return to “SOFTWARE PROGRAMMING & DISCUSSION”

Who is online

Users browsing this forum: ClaudeBot and 3 guests