You will not be able to post if you are still using Microsoft email addresses such as Hotmail etc
See here for more information viewtopic.php?f=20&t=7296
See here for more information viewtopic.php?f=20&t=7296
BOOKMARK THIS PAGE !
https://www.exxosforum.co.uk:8085/IP_CHECK/
You can unban yourself if needed. It also sends me reports to investigate the ban.
https://www.exxosforum.co.uk:8085/IP_CHECK/
You can unban yourself if needed. It also sends me reports to investigate the ban.
DO NOT USE MOBILE / CGNAT DEVICES WHERE THE IP CHANGES CONSTANTLY!
At this time, it is unfortunately not possible to whitelist users when your IP changes constantly.
You may inadvertently get banned because a previous attack may have used the IP you are now on.
So I suggest people only use fixed IP address devices until I can think of a solution for this problem!
At this time, it is unfortunately not possible to whitelist users when your IP changes constantly.
You may inadvertently get banned because a previous attack may have used the IP you are now on.
So I suggest people only use fixed IP address devices until I can think of a solution for this problem!
Converting HISOFT to 68K ASM "almost" works
-
exxos
- Site Admin

- Posts: 28155
- Joined: 16 Aug 2017 23:19
- Location: UK
Re: Converting HISOFT to 68K ASM "almost" works
Theres another routine in the mix..
forcing DM=1 (binary mode) here
DATA% = BITSET%(2,DATA%) ' SET BINARY MODE
so as it reads back as 1 that must be correct.
I forgot its a multiplexed bus which is confusing things as well :roll:
forcing DM=1 (binary mode) here
DATA% = BITSET%(2,DATA%) ' SET BINARY MODE
so as it reads back as 1 that must be correct.
I forgot its a multiplexed bus which is confusing things as well :roll:
-
mrbombermillzy
- Moderator

- Posts: 2266
- Joined: 03 Jun 2018 19:37
Re: Converting HISOFT to 68K ASM "almost" works
Ok, yes, guessing at the HS BASIC language constructs, that looks to be correct.
Can you find any references to register offset $09h?
(Probably called something else in BASIC or the assembly, but both must set the name with a reference to memory location Base address of RTC registers + $09h.)
Can you find any references to register offset $09h?
(Probably called something else in BASIC or the assembly, but both must set the name with a reference to memory location Base address of RTC registers + $09h.)
-
exxos
- Site Admin

- Posts: 28155
- Joined: 16 Aug 2017 23:19
- Location: UK
Re: Converting HISOFT to 68K ASM "almost" works
The INIT routine has
Code: Select all
'SET YEAR TO 20
POKEW (RTC_ADDRESS&),&B1111111100001001 ' SET ADDRESS 09H
POKEW (RTC_DATA_ADDRESS&),&B1111111100010100It reads and writes fine there, it shows all correct time and date.
The assembly program reads the correct value, but seems to somehow end up with 28 for the year in control panel.
-
mrbombermillzy
- Moderator

- Posts: 2266
- Joined: 03 Jun 2018 19:37
Re: Converting HISOFT to 68K ASM "almost" works
Ok, lets roll back to a good place to start. How about changing this:
to this:
In your 2nd code example just before my first reply on page 1.
As Im not sure what format GEM expects the answer, you might also have to try:
Ive added some extra 'failsafe' instructions (namely possibly clearing any garbage data in d0) to the above routines just in case thats the bug.
Code: Select all
* Year (reg 9)
move.w #$FF09,(RTC_ADDR)
move.w (RTC_DATA),d0
sub.w #$FF00,d0
move.w d0,d7 ; save YR in d7
Code: Select all
* Year (reg 9)
move.w #$FF09,(RTC_ADDR)
clr.l d0
move.w (RTC_DATA),d0 ; save YR in d0
As Im not sure what format GEM expects the answer, you might also have to try:
Code: Select all
* Year (reg 9)
move.w #$FF09,(RTC_ADDR)
clr.l d0
move.w (RTC_DATA),d0
andi.w #$00FF,d0 ; cut top byte values
Code: Select all
* Year (reg 9)
move.w #$FF09,(RTC_ADDR)
clr.l d0
move.w (RTC_DATA),d0
andi.w #$FF00,d0 ; cut bottom byte values
-
exxos
- Site Admin

- Posts: 28155
- Joined: 16 Aug 2017 23:19
- Location: UK
Re: Converting HISOFT to 68K ASM "almost" works
Its this code which is the "best" one
viewtopic.php?p=139538#p139538
I tried it again, and the year gets output as 26, but now CP is set to 42 as the year... :stars:
With your changes..
debug year shows 0, year in CP still shows 42 .
My brain hurts..
viewtopic.php?p=139538#p139538
I tried it again, and the year gets output as 26, but now CP is set to 42 as the year... :stars:
With your changes..
debug year shows 0, year in CP still shows 42 .
My brain hurts..
-
mrbombermillzy
- Moderator

- Posts: 2266
- Joined: 03 Jun 2018 19:37
Re: Converting HISOFT to 68K ASM "almost" works
Ok, it seems there is some sort of data transform/adjustment either somewhere else, or in the GEM end. Let me have a look...
-
mrbombermillzy
- Moderator

- Posts: 2266
- Joined: 03 Jun 2018 19:37
Re: Converting HISOFT to 68K ASM "almost" works
Ok, apparently the year is stored in the high byte.
So try changing the 2nd attempt code again with:
Im not sure you tried this, as I was editing my post with failsafe test values when you answered. (Read the post 3 places up; I think this is the option you need).
So try changing the 2nd attempt code again with:
Code: Select all
* Year (reg 9)
move.w #$FF09,(RTC_ADDR)
clr.l d0
move.w (RTC_DATA),d0
andi.w #$FF00,d0 ; cut bottom byte values
-
exxos
- Site Admin

- Posts: 28155
- Joined: 16 Aug 2017 23:19
- Location: UK
Re: Converting HISOFT to 68K ASM "almost" works
Didn't see that one no.. but the year just comes back as zero ago..mrbombermillzy wrote: 09 Feb 2026 20:21 Ok, apparently the year is stored in the high byte.
So try changing the 2nd attempt code again with:
Im not sure you tried this, as I was editing my post with failsafe test values when you answered. (Read the post 3 places up; I think this is the option you need).Code: Select all
* Year (reg 9) move.w #$FF09,(RTC_ADDR) clr.l d0 move.w (RTC_DATA),d0 andi.w #$FF00,d0 ; cut bottom byte values
The read of the year seems fine, its writing it to GEMDOS which seems where things go nuts.
-
mrbombermillzy
- Moderator

- Posts: 2266
- Joined: 03 Jun 2018 19:37
Re: Converting HISOFT to 68K ASM "almost" works
Looks like its using GEMDOS function $09 PRINT LINE which converts numerical data into character data.exxos wrote: 09 Feb 2026 20:31 The read of the year seems fine, its writing it to GEMDOS which seems where things go nuts.
Im sure the routine that does the conversion needs further study then... :coffee:
-
mrbombermillzy
- Moderator

- Posts: 2266
- Joined: 03 Jun 2018 19:37
Re: Converting HISOFT to 68K ASM "almost" works
This then is that part of the code:
Im going to have to bail out in a minute (sorry), but I will see if I can quickly find anything obvious.
Code: Select all
* PRINT_NUM: prints 0-99 as decimal string + CRLF (no leading zero)
PRINT_NUM:
movem.l d1/a1,-(sp)
lea BUFFER(PC),a1
cmpi.w #10,d0
bcs.s .one
clr.l d1 ; clear high word for clean dividend
move.w d0,d1
divu.w #10,d1
swap d1 ; remainder in low
addi.b #'0',d1
move.b d1,1(a1) ; units
swap d1 ; quotient in low
addi.b #'0',d1
move.b d1,(a1) ; tens
moveq #2,d1
bra.s .out
.one:
addi.b #'0',d0
move.b d0,(a1)
moveq #1,d1
.out:
clr.b (a1,d1.w)
pea (a1)
move.w #9,-(sp)
trap #1
addq.l #6,sp
pea CRLF(PC)
move.w #9,-(sp)
trap #1
addq.l #6,sp
movem.l (sp)+,d1/a1
rts
Who is online
Users browsing this forum: CCBot and 11 guests