Page 2 of 3
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 15:17
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..
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 15:32
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?)
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 15:40
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.
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 16:11
by mfro
at least in your previous code post, it appears you are missing a terminating 0 byte after the string.
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 16:23
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 (61.33 KiB) Viewed 3167 times
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 16:53
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.
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 16:57
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:
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 16:58
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:
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 17:04
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 :)
Re: ASM detect CPU type ?
Posted: 08 Dec 2022 18:47
by exxos
So this seems to be causing it to crash even just by itself :shrug: