6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Jul 01, 2024 9:23 am

All times are UTC




Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Fri Jun 22, 2018 7:12 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Quote:
May it be that the terminal client software get's confused about the missing $0D characters causing that garbage to appear?


In that case, you'd see the text coming down a line and continuing right, instead of going back to the left margin - not hash.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 22, 2018 7:20 pm 
Offline

Joined: Thu Apr 12, 2018 8:27 pm
Posts: 33
Location: RS/Brazil
Isn't that what happens right after "Enhanced BASIC 2.22" ?

Could also be that the $00 isn't catched and output continues fetching characters beyond the text.

Switching terminal output mode to HEX could leverage the mystery what these characters are ore come from.

Just a thought.

Quote:
LAB_MSZM
!raw $0D,$0A,"Memory size ",$00

LAB_SMSG
!raw " Bytes free",$0D,$0A,$0A
!raw "Enhanced BASIC 2.22",$0A,$00

; numeric constants and series

; constants and series for LOG(n)
LAB_25A0
!8 $02 ; counter
!8 $80,$19,$56,$62 ; 0.59898
!8 $80,$76,$22,$F3 ; 0.96147
;## !8 $80,$76,$22,$F1 ; 0.96147
!8 $82,$38,$AA,$40 ; 2.88539
;## !8 $82,$38,$AA,$45 ; 2.88539


Chromatix wrote:
Quote:
May it be that the terminal client software get's confused about the missing $0D characters causing that garbage to appear?


In that case, you'd see the text coming down a line and continuing right, instead of going back to the left margin - not hash.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 22, 2018 8:17 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
I think some of those strings are meant to be printed as-is, and some after going through a translator. Sort-of like the difference between OSWRCH and OSASCI in Acorn MOS.

Bizarrely, a "print null terminated string" routine appears to redirect to a "print quote terminated string" routine. Yet the hash contains a quote character. This makes no sense whatsoever.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 22, 2018 11:15 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1938
Location: Sacramento, CA, USA
I think I can see the numeric constants for LOG(n) being printed as ASCII, especially the $56, $62 and the $76, $22 and the $38 and the $40. Does anyone else see it?

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 22, 2018 11:54 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
These 4 byte sequences are normalized floating point representations with a "biased exponent" and a "hidden bit" in the matissa.

The first byte holds the "biased" exponent. Bias is simply an add of $80 to the value of the exponent. In the case of "$80,$19,$56,$62" the exponent is $80-$80=0.
The next three bytes are the normalized 24 bit mantissa with a hidden bit. This hidden bit is the topmost bit of that 24 bits that is always 1 due to normalization (which means the mantissa has a value between 0.5 and <1). As the topmost bit is always 1 it is removed to hold the sign bit of the mantissa. In this case the bit is 0 so the matissa is positive and has a value of $995662 / 2^24 = 10,049,122/16,777,216 = 0.59897435

The last number $82,$38,$AA,$40 is $B8AA40 / 2^24 * 2^($82-80) = 12102208/16777216 * 2^2 = 2,8853912


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 23, 2018 1:15 am 
Offline

Joined: Tue Jun 19, 2018 8:28 am
Posts: 122
Problem solved. It turned out to be an effect of using the X register inside I/O TX routine.
Is it possible to hardcode memory amount for cold boot, to not be asked about it every time?


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 23, 2018 1:27 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1938
Location: Sacramento, CA, USA
GaBuZoMeu wrote:
These 4 byte sequences are normalized floating point representations with a "biased exponent" and a "hidden bit" in the matissa.

[ excellent and detailed explanation snipped ]

Yeah, but what happens if your print string routine doesn't know when to stop, and just plows through those binaries as if they were ASCII? A unique and repeatable type of "hash", right? :wink:

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 23, 2018 6:48 am 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
Well, printing beginning @E338 on the badge (with EhBasic2.22) gives:
Code:
>e330.e3ffq

E330 - ...r....Memory s
E340 - ize . Bytes free
E350 - ...Enhanced BASI
E360 - C 2.22.....Vb.v"
E370 - s.8*@.5.s.5.s...
E380 - ..1r..COx.t#w.t$
E390 - ..8*;.tc..w#.+z.
E3A0 - ..|cB.~u~P.1r...
E3B0 - ...I.[...W{..&e.
E3C0 - #4X.%]a.I.[.x:E7
E3D0 - {."\|.]M}.0.}Ym$
E3E0 - ~.r.~L9s.**S....
E3F0 - .............. .

:roll:


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 23, 2018 9:50 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1938
Location: Sacramento, CA, USA
So you can see it too?

Attachment:
eh1.JPG
eh1.JPG [ 16.18 KiB | Viewed 3482 times ]


Attachment:
eh2.JPG
eh2.JPG [ 18.5 KiB | Viewed 3482 times ]


Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 23, 2018 11:52 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
barrym95838 wrote:
So you can see it too?

Sure. It is not identical, but who can estimate what a galloping X register might cause. :lol:


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 24, 2018 6:26 am 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
Atlantis wrote:
Is it possible to hardcode memory amount for cold boot, to not be asked about it every time?
Yes, but you would no longer be able to reserve RAM space for machine code to be called by CALL or USR() statements. After all it takes only a hit to the [ENTER] key entering an empty line to take the default from Ram_top.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 24, 2018 6:41 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Since he has an area of banked RAM that isn't included in the BASIC memory area, I think he can safely hard-code the latter.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: