Hi Rune,
Here is my attempt.
I skipped the first value "8D" from each of your files because I don't know
what it is.
Please let me know if it makes sense to you.
I also attached a C program I used to untokenize them.
Clint
On Thu, Apr 2, 2026 at 8:24 PM Rune Devik <[email protected]> wrote:
> Soo, I need some help... If it's not super trivial we may even call it an
> Easter Egg Hunt ;)
>
> At long last I managed to dump the cassette with the Norwegian telecom
> program to my PC as a wav file. Using the following tools I managed to
> extract the hex dumps attached:
> * https://knut.one/wav2cas.htm
> * https://knut.one/PlayCAS.htm
>
> I have sort of managed to translate it to BASIC as well but I believe I
> have some errors so not posting my "findings" just yet.
>
> * The RESRAM script should delete all files and reserve some space for the
> INSTAL program
> * The INSTAL program I assume is a ML program wrapped in a BASIC loader
> script. This program should display a menu and enable me to select between
> English or Norwegian Telecom/Printer/Line feed.
>
> The question is: Can somebody here help me translate the attached hex
> dumps (tokenized BASIC) to the corresponding de-tokenized BASIC programs
> correctly?
>
> I also have the wav file if that would be helpful as well.
>
> Regards,
> Rune Devik
>
> On Wed, Jan 28, 2026 at 11:24 PM B 9 <[email protected]> wrote:
>
>> I had been wondering what changes were necessary in TELCOM; the fact that
>> Norway used their own 7-bit version of ASCII would explain the need
>> completely. TELCOM would need to transcode between that and the Model T
>> character set. Does TELCOM on your machine convert those characters without
>> loading the cassette program? Once you get your cassette deck working, I
>> hope you share with us what the difference is between the three versions:
>> plain ROM, Norwegian, and US.
>>
>> Looking at the International Register’s list of nationalized character
>> sets
>> <https://github.com/hackerb9/vt340test/blob/main/docs/standards/ISO_IR_Character_Set_Registry_2004.pdf>,
>> it seems Denmark and Norway shared a single character set in the early days
>> (IR-09 1975 <https://itscj.ipsj.or.jp/ir/009-1.pdf>) as did Finland and
>> Sweden, and both were sponsored by the Scandinavian Newspaper Technical
>> Cooperation Council (NATS). It wasn’t until 1982 that Norway registered its
>> own character set (IR-60 1982 <https://itscj.ipsj.or.jp/ir/060.pdf>,
>> based on Norwegian Standard NS 4551). Both of those are supersets of the
>> table you showed. IR-60 additionally changes character 7E, ~, to be ‾,
>> while IR-09 changes ~ to be -.
>>
>> While I doubt the Televerket Modell 100 would be influenced at all by
>> IR-09, here’s a chart showing the differences from ASCII you may want to
>> look out for when testing TELCOM.
>> Hex ASCII IR-09 (1975) IR-60 (1982)
>> 20 space (variable width space)
>> 22 ” « (opening quotation mark)
>> 23 # » (closing quotation mark)
>> 2D - — (long dash or minus)
>> 40 @ (short fixed width space)
>> 5B [ Æ Æ
>> 5C \ Ø Ø
>> 5D ] Å Å
>> 5E ^ █ (solid)
>> 60 ` (long fixed width space)
>> 7B { æ æ
>> 7C | ø ø
>> 7D } å å
>> 7E ~ - (short dash or hyphen ) ‾ (overline)
>>
>> —b9
>>
>> On Wed, Jan 28, 2026 at 8:46 AM Rune Devik <[email protected]> wrote:
>>
>>> Hi Jonathan
>>>
>>> yup, this was before my time (I can't remember it) but we also
>>> apparently had the same thing. The norwegian wikipedia article about ascii
>>> explains this (https://no.wikipedia.org/wiki/ASCII):
>>>
>>> Binært Desimal Hex ASCII Norsk
>>> 101 1011 91 5B [ Æ
>>> 101 1100 92 5C \ Ø
>>> 101 1101 93 5D ] Å
>>> 111 1011 123 7B { æ
>>> 111 1100 124 7C | ø
>>> 111 1101 125 7D } å
>>> To answer B9's question: I guess there was changes made to Telecom
>>> because they where needed and because the national telephone company
>>> actually sold these. But that's just a guess. I haven't really found any
>>> articles about how Televerket worked to get this out the door. Only a few
>>> adverts and some news articles about journalists really embracing this
>>> machine. On the back of the machine it says Custom mfd. for Tandy
>>> Corporation. So it would be my guess that Televerket worked with Tandy
>>> corp. and they actually did the needed changes (in coop with MS if needed).
>>>
>>> The prime customer for the m100 in Norway was reporters. But that might
>>> just be what accidently happened after it went on sale. But also Norwegians
>>> need the ÆØÅ chars to effectively communicate natively as the ÆØÅ chars are
>>> quite frequently used :) And there was already other machines that did this
>>> like e.g. the TIKI-100. I also think my Commodore 128 actually is localized
>>> to Norwegian now that I think about it...
>>>
>>> I don't think you can count this machine in as part of any computer
>>> literacy project though. That probably was the native TIKI-100 machine
>>> (more high end real personal computer) and the commodore 64 which was
>>> really popular over here (like everywhere else I guess).
>>>
>>> We also produced the super high end main frame stuff in-house (by Norsk
>>> Data). This video is pretty good at explaining the raise and fall of
>>> Nowegian computing: https://youtu.be/CswjD3plsF8?si=Wd9oxhD1awWt4zlS
>>>
>>> In a alternative universe we might have been a big player in the market
>>> :)
>>>
>>> On Wed, Jan 28, 2026 at 2:25 PM <[email protected]> wrote:
>>>
>>>> My m100 is a US model so I can't check things there, but I know that
>>>> there was a '7 bit ASCII' that was adapted for Sweden, where the "å ä ö
>>>> Å Ä Ö" shows up as "} { | ] [ \" and vice-versa. This was before the
>>>> IBM code pages and of course much before UTF. It made code writing
>>>> much
>>>> harder. At one point, I could almost read Swedish with things like |
>>>> or
>>>> { mixed in the words but I haven't seen anything like that for a while.
>>>> We still have to use the 'Alt Gr' key to get '} { | ] [ \' from a
>>>> Swedish keyboard.
>>>>
>>>> Did they have somethings like that in Norway that represented the
>>>> 'extra
>>>> letters' by replacing '} { | ] [ \'? You can find the Swedish version
>>>> on
>>>> wikipedia under 'Svensk ASCII' .
>>>>
>>>> Jonathan
>>>>
>>>> > ------ Original Message ------
>>>> > From: [email protected]
>>>> > To: [email protected]
>>>> > Sent: Tuesday, January 27th 2026, 23:58
>>>> > Subject: Re: [M100] M100Link - Transfer files to/from your m100
>>>>
>>>> >
>>>> Oh, that's good that the ROM actually works properly without the
>>>> cassette. I wonder what the "Norwegian TELCOM" program actually does
>>>> since the ROM already includes TELCOM. Was it a last minute patch,
>>>> maybe
>>>> needed for a different method of dialing? >
>>>> >
>>>> It makes sense that the case-insensitivity is broken for nationalized
>>>> characters: the Model-T character map above 128 is laid out
>>>> higgledy-piggledy, unlike the ASCII alphabet where one can trivially
>>>> force letters to uppercase with a single machine instruction (`c AND
>>>> 223`).>
>>>> >
>>>> If the Modell 100's permit was issued in 1984, that means the changes
>>>> to the ROM had already been planned (and possibly already implemented).
>>>> So, now, I'm thinking of the evolution of the Kyocera sisters as
>>>> something like this:>
>>>> >
>>>> Kyocera Kyotronic KC-85>
>>>> ⮩ TRS-80 Model 100>
>>>> ⮩ TRS-80/Televerket Modell 100>
>>>> ⮩ Tandy 200>
>>>> ⮩ Tandy 102>
>>>> ⮩ Olivetti M10 (European)>
>>>> >
>>>> >
>>>> >
>>>> ⮩ Olivetti M10 (North America)>
>>>> ⮩ NEC PC-8201 (Japan) and -8201A (Export) ⮩ NEC PC-8300>
>>>> >
>>>> I'm curious what the connection was between Tandy / Radio-Shack and
>>>> Televerket that lead to the creation of a customized ROM for the
>>>> Norwegian market. Are you able to search the Norwegian newspapers
>>>> archives and see if Televerket paid Microsoft for the ROM update or
>>>> maybe made the changes in house? Was it part of a governmental mandate
>>>> for promoting the Norwegian language and, if so, was it considered a
>>>> successful project?>
>>>> >
>>>> —b9>
>>>> >
>>>> >
>>>> On Mon, Jan 26, 2026 at 8:00 AM Rune Devik <[email protected]>
>>>> wrote:>
>>>> Hi>
>>>> ÆØÅ>
>>>> * It actually works correctly and prints ÆØÅ and æøå to screen as you
>>>> would expect even without loading the software. When I read the
>>>> pamphlet
>>>> and the screen displayed for the INSTAL program it translates to:>
>>>> * Press 1 for Norwegian Telecom>
>>>> * Press 2 for English Telecom>
>>>> * Press 3 for Norwegian Printer>
>>>> * Press 4 for English Printer>
>>>> * Press 5 for CR & LF>
>>>> * Press 6 for CR>
>>>> * F8 for Menu>
>>>> So the program apparently is for telecom and printer settings and if
>>>> LF should be used in combination with CR or not (not sure where though
>>>> probably just telecom and printer related as well). I'll put the
>>>> translation of the choices in the "wiki" on both github and
>>>> archive.org. >
>>>> >
>>>> Note: When I say that ÆØÅ works as expected there's actually a
>>>> difference. If I create a file in the text editor and call it æøå and
>>>> go
>>>> to the main screen I have a file with lower case filename æøå. And I
>>>> can
>>>> also create a file that is called ÆØÅ and that will be displayed as ÆØÅ
>>>> on the main menu. If you create a file called note it will be shown as
>>>> NOTE on the main menu and you won't be able to create both a note and a
>>>> NOTE file. >
>>>> >
>>>> With regards to the age of the machine I'm actually not sure. I can
>>>> check the date code on the IC's inside next I pop it open. Or see if I
>>>> have some images of that laying around. Even though the permit was from
>>>> 1984 for these it doesn't necessarily mean that the machines was
>>>> produced the same year.>
>>>> >
>>>> PRINT CHR$(208) - This does indeed print Æ. I have not looked at the
>>>> model 102 at all so not sure if this differs from that or not. But I
>>>> see
>>>> that a lot of the keys (especially on the right hand side and number
>>>> keys shift function) has been moved around to accommodate ÆØÅ but still
>>>> keep the needed functionality. To be able to enter <> and [] I need to
>>>> use the code button in addition to some button on the right side of the
>>>> keyboard (can't remember which).. But all chars I need seems to be
>>>> there. >
>>>> >
>>>> Regards,>
>>>> Rune Devik >
>>>> >
>>>> On Mon, Jan 26, 2026 at 9:31 AM B 9 <[email protected]> wrote:>
>>>> Oh, duh! I just realized that your machine is probably one of the
>>>> reasons why the font changed in the Tandy 200 and 102. If you do>
>>>> PRINT CHR$(208)>
>>>> </pre> I bet it’ll show you Æ, like the later models, instead of  as
>>>> the original Model 100 did. >
>>>> —b9>
>>>> >
>>>> >
>>>> >
>>>> On Mon, Jan 26, 2026 at 12:24 AM B 9 <[email protected]> wrote:>
>>>> Again, nice work! It's fun seeing a Model 100 with
>>>> keycaps nationalized for your country!>
>>>> >
>>>> By the way, what do Ø, Æ, and Å show on the screen if you press them
>>>> when you haven't loaded the nationalization program, RESRAM.BA and
>>>> INSTAL.BA, from the cassette? I wonder i the keyboard works just like
>>>> the American layout, despite the keycaps. I'm also curious if the
>>>> nationalization program changes what character code gets read when a
>>>> key
>>>> is pressed or (less likely) if it is only changing what is displayed on
>>>> the screen.>
>>>> >
>>>> Looking at the diff between the ROMs for the Televerket Modell 100
>>>> and
>>>> the Tandy 102, there are actually very few differences, mostly in the
>>>> date/time section. You said that this device was being sold in 1984,
>>>> right? That's interesting to me since the Tandy 102 didn't come out
>>>> until two years later, in 1986, and I always presumed that the
>>>> firmware's direct ancestor was the ROM in the Tandy 200 which came out
>>>> in 1985. However, it's possible they both have a common ancestor in
>>>> your
>>>> Televerket or something similar. Do you know if your machine's font is
>>>> more like the Model 100 or the Tandy 102?>
>>>> >
>>>> —b9 >
>>>> >
>>>> >
>>>> >
>>>> On Sun, Jan 25, 2026 at 3:41 AM Rune Devik <[email protected]>
>>>> wrote:>
>>>> Hi, thanks :)>
>>>> Your gentle encouragement led to
>>>> this: https://archive.org/details/trs-80-m100-norwegian>
>>>> >
>>>> Regards,>
>>>> Rune Devik>
>>>> >
>>>> On Sun, Jan 25, 2026 at 8:02 AM B 9 <[email protected]> wrote:>
>>>> Wow, great job with the documentation! Once you’re finished, I'd like
>>>> to gently encourage you to consider storing it also on archive.org. >
>>>> For deskewing the pamphlet images, you can do it when converting to
>>>> PDF. In particular, the ocrmypdf command has a --deskew option. This is
>>>> what I did on my Unix computer:>
>>>> img2pdf --title "TRS 80 Modell 100: Kortfattet
>>>> brukerveiledning"
>>>> \>
>>>> --keywords "TRS-80, m100, Norvegian" \>
>>>> --creationdate "January 01, 1984" \>
>>>> Pamphlet*.png \>
>>>> | ocrmypdf --deskew - pamphlet.pdf>
>>>> </pre> By the way, it may make sense to add the original JPEG photos
>>>> to the repository. PDFs usually work best with JPEG or TIFF images, not
>>>> PNG, as no conversion is necessary. >
>>>> And, yes, the soigeneris Backpack looks quite nifty. I don’t have
>>>> one
>>>> yet, but plan on getting one whenever they are back in stock.>
>>>> —b9>
>>>> On January 24, 2026 11:24:01 AM PST, Rune Devik
>>>> <[email protected]> wrote:>
>>>> >
>>>> >
>>>> That universal backpack looks nice :) >
>>>> I'm almost finished documenting my machine, the box it came with, the
>>>> pamphlet, Cassette (not yet recorded but...), ROM etc. And I have put
>>>> everything up on GitHub for now (of all places..):
>>>> https://github.com/Warshi7819/TRS80-M100-Norwegian>
>>>> >
>>>> Regards,>
>>>> Rune Devik>
>>>> >
>>>> On Sat, Jan 24, 2026 at 2:09 AM B 9 <[email protected]> wrote:>
>>>> The double cassette deck sounds like the way to go. I don't know
>>>> about
>>>> testing the .wav file out, other than just playing it back from your
>>>> computer and loading it on your Model T. If you need to do it in
>>>> emulation, a good bet is to try MAME's tandy102 as that emulates the
>>>> device at the chip level. >
>>>> >
>>>> If you are not so fond of cassettes any more, you may want to
>>>> investigate getting a REX# chip or a Universal Backpack. I held off for
>>>> a long time because I wanted to experience the way computing was "back
>>>> in the day", but eventually, it just made more sense to get one of the
>>>> modern solutions.>
>>>> >
>>>> —b9 >
>>>> >
>>>> >
>>>> On Fri, Jan 23, 2026 at 12:59 PM Rune Devik <[email protected]>
>>>> wrote:>
>>>> Hi!>
>>>> >
>>>> Thanks for the transformed dump :)>
>>>> >
>>>> I have a new double cassette deck at my cabin (three years old) so I
>>>> was thinking about bringing in that bad boy to dump the tape. Is there
>>>> software that can take a wav file and create a cas file for the trs-80
>>>> model 100? And is it possible to load a cas file on the emulator
>>>> (Virtual T) to test that the dump actually works?>
>>>> >
>>>> The belts I bought was for the specific model I have (Philips D6280).
>>>> And they seemed good. A lot tighter than the once I had initially at
>>>> least but not too tight either. But the speed of the cassette deck is
>>>> still going up and down.. Could be slipping as you say. You can hear it
>>>> very well when playing music cassettes on it. And I was not able to
>>>> record and load a short program on my trs-80 coco (or was it the
>>>> Dragon)
>>>> with it either so it's not doing it's job it seems. I'm not sure I like
>>>> cassettes for software. Me, cassettes and Azimuth head alignment go way
>>>> back as nobody in Europe could afford floppies back in the 80's... :)>
>>>> >
>>>> >
>>>> On Fri, Jan 23, 2026 at 9:32 PM B 9 <[email protected]> wrote:>
>>>> By the way, a slow speed recording can be easily corrected as long as
>>>> it is consistent. If I remember right, the TRS-80 audio data format
>>>> starts with a tone of a specific frequency, making it relatively easy
>>>> to
>>>> see (in Audacity's spectrum mode) if the speed is steady and how much
>>>> of
>>>> an adjustment is needed. If your cassette deck isn't having other
>>>> problems, like chewing up tapes, I think it'd be worth a shot uploading
>>>> the incorrect speed. >
>>>> >
>>>> I would not suspect capacitors or the motor for the speed problem, at
>>>> least, not at first. Did you buy a replacement belt of exactly the same
>>>> size as the old belt? If so, it likely would be too loose since they
>>>> get
>>>> stretched out. Another problem I've seen is the rubber of the pinch
>>>> roller hardening to a glaze and slipping. >
>>>> >
>>>> —b9>
>>>> >
>>>> On Fri, Jan 23, 2026 at 4:30 AM Rune Devik <[email protected]>
>>>> wrote:>
>>>> Hi>
>>>> So, attached is the dump of the ROM. The file romdump_real.txt is the
>>>> output from running Clinton's basic script. The output_hex.txt file is
>>>> my creation by extracting all the numbers from the romdump_real.txt
>>>> file
>>>> and then converting the numbers to hex pairs using
>>>> python format(int(value), '02X')>
>>>> >
>>>> I was kinda expecting that I would find some version info or some
>>>> ascii text in the rom dump but browsing through it I didn't see
>>>> anything
>>>> like that in my hex editor.>
>>>> >
>>>> Anyways, please share any insights you might get when looking at
>>>> these
>>>> dumps :). >
>>>> >
>>>> Also back to another of B9's questions: Yes, I have the cassette that
>>>> came with the unit as well but I haven't recorded it yet. Basically
>>>> because my cassette deck I have at hand is not behaving correctly at
>>>> the
>>>> moment. I haven't had the time to fix it yet. The motor is not running
>>>> at full speed (I have changed the belts) so either caps or the motor
>>>> itself. The M100 also came with a Norwegian pamphlet and the full hefty
>>>> Tandy M100 manual (in English). I will try to scan the Norwegian
>>>> pamphlet and share that on arhive.org as well. >
>>>> >
>>>> Regards,>
>>>> Rune Devik>
>>>> >
>>>> On Fri, Jan 23, 2026 at 11:30 AM Rune Devik <[email protected]>
>>>> wrote:>
>>>> Hi>
>>>> Also verified that * PEEK(63789) returns Year (ones place)*
>>>> PEEK(63790) returns Year (tens place)Just like the US and UK model in
>>>> your table. >
>>>> >
>>>> On Fri, Jan 23, 2026 at 11:24 AM Rune Devik <[email protected]>
>>>> wrote:>
>>>> Hi>
>>>> Unfortunately PEEK(1) returns 167 on my Norwegian model as well.
>>>> Which
>>>> means that it's probably based on the American version and that is also
>>>> indicated by the sticker on the back where it says "Custom mfd. in
>>>> Japan
>>>> for Tandy Corporation". But as stated before the date format is
>>>> DD/MM/YY.>
>>>> >
>>>> I'll send the full dump of the ROM as soon as I have had the time to
>>>> do it!>
>>>> >
>>>> Regards,>
>>>> Rune Devik>
>>>> >
>>>> On Fri, Jan 23, 2026 at 10:34 AM B 9 <[email protected]> wrote:>
>>>> Did you send the value from PEEK? That file contains this repeating
>>>> sequence:>
>>>> >
>>>> ```>
>>>> 00>
>>>> 01>
>>>> 02>
>>>> 03>
>>>> 04>
>>>> …>
>>>> FC>
>>>> FD>
>>>> FE>
>>>> FF>
>>>> ```>
>>>> >
>>>> Oddly symmetric indeed!>
>>>> >
>>>> —b9>
>>>> >
>>>> >
>>>> On Thu, Jan 22, 2026 at 4:39 PM Rune Devik <[email protected]>
>>>> wrote:>
>>>> Hi>
>>>> After reducing the speed to 1200 bauds I finally managed to dump the
>>>> rom but I think this script dumps the optional rom? And not the "main"
>>>> rom? It dumped the data but it seemed strangely symetric when I saw the
>>>> data pass by lie it was repeating itself over and over so not sure
>>>> there's actually any info there. Which makes sense as there is no
>>>> optional rom installed. Or I might be completely wrong and this is it.
>>>> I
>>>> could not make sense of it in a hex editor either... But this is not my
>>>> expertise so any help appreciated :)>
>>>> >
>>>> At least the file is exactly the correct size as it should be. >
>>>> >
>>>> On Thu, Jan 22, 2026 at 7:05 PM Joshua O'Keefe
>>>> <[email protected]> wrote:>
>>>> > On Jan 22, 2026, at 7:43 AM, Joshua O'Keefe
>>>> <[email protected]> wrote: > > I'm fairly sure I've seen
>>>> software to do this posted here on the list in the past. I'd be willing
>>>> to bet Stephen A. has something on hand because this is very much his
>>>> wheelhouse. Curiosity got the better part of me. Stephen does have
>>>> such
>>>> a utility posted[1] that ought to work with a USB/RS-232 bridge on the
>>>> other end. It produces a hex dump rather than binary data, so you might
>>>> need to poke around for a utility to decode ASCII hex pairs to binary.
>>>> [1]
>>>>
>>>> https://www.club100.org/memfiles/index.php?&direction=0&order=&directory=Steve%20Adolph/ROM2S
>>>> >
>>>> >
>>>> >
>>>> -- mvh,>
>>>> Rune Devik>
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> -- mvh,>
>>>> Rune Devik>
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> -- mvh,>
>>>> Rune Devik>
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> -- mvh,>
>>>> Rune Devik>
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> -- mvh,>
>>>> Rune Devik>
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> -- mvh,>
>>>> Rune Devik>
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> -- mvh,>
>>>> Rune Devik>
>>>> >
>>>> >
>>>> >
>>>>
>>>>
>>>>
>>>>
>>>> [email protected]
>>>>
>>>>
>>>
>>> --
>>> mvh,
>>> Rune Devik
>>>
>>
>
> --
> mvh,
> Rune Devik
>
10CLS
20PRINT @162, "Har du husket / kjANDre RESRAM (J/N)
30A$=INKEY$:IF A$=""THEN 30
40IF A$="n" OR A$="N" THEN200
50IF A$="j" OR A$="J" THEN 80
60BEEP:CLS:GOTO10
80CLS
90PRINT @172,"Vent i ca. 5 sek."
100FOR X=32771 TO 33256
110READ A
130POKE X,A
140NEXT X
160CALL 32771
200CLS:PRINT @121,"Trykk 'B' for / g/ tibake til BASIC for / lese inn og
kjANDre RESRAM"
210C$=INKEY$:IF C$=""THEN210
220IF C$="B"THENCLS: NEW
230CLS:GOTO 10
500DATA 205,49,66,6,193,33,241,128,126
510DATA 231,5,35,194,11,128,175,205,66
520DATA 114,202,19,128,218,65,128,254
530DATA 49,204,118,128,254,50,204,73
540DATA 128,254,51,204,178,129,254,52
550DATA 204,190,129,254,53,204,96,128
560DATA 254,54,204,107,128,175,205,98
570DATA 118,195,3,128,254,7,204,151,87
580DATA 195,19,128,62,201,50,252,245,33
590DATA 0,0,34,253,245,33,243,127,34,10
600DATA 251,62,46,50,167,129,201,62,1
610DATA 50,90,246,62,42,50,177,129,201
620DATA 62,0,50,90,246,62,46,50,177,129
630DATA 201,62,195,50,252,245,33,141
640DATA 128,34,253,245,33,184,128,34,10
650DATA 251,62,42,50,167,129,201,243
660DATA 227,213,197,245,33,247,113,229
670DATA 219,200,33,141,255,166,245,33
680DATA 215,128,241,190,202,178,128,35
690DATA 35,245,126,254,255,194,160,128
700DATA 241,195,180,128,35,126,251,195
710DATA 189,109,243,229,121,245,33,228
720DATA 128,241,190,202,209,128,35,35
730DATA 245,126,254,255,194,191,128
740DATA 241,195,211,128,35,126,79,225
750DATA 251,201,91,208,92,212,93,210
760DATA 123,209,124,213,125,211,255
770DATA 208,91,212,92,210,93,209,123
780DATA 213,124,211,125,255,9,68,69,70
790DATA 73,78,73,83,73,79,78,32,65,86
800DATA 32,75,65,82,65,75,84,69,82,83
810DATA 69,84,84,10,13,32,32,32,49,58
820DATA 32,110,111,114,115,107,32,116
830DATA 101,108,99,111,109,32,32,32,50
840DATA 58,32,101,110,103,101,108,115
850DATA 107,32,116,101,108,99,111,109
870DATA 10,13,32,32,32,51,58,32,110,111
880DATA 114,115,107,32,115,107,114,105
890DATA 118,101,114,32,32,52,58,32,101
900DATA 110,103,101,108,115,107,32,115
910DATA 107,114,105,118,101,114,10,13
920DATA 32,32,32,53,58,32,32,67,82,32
930DATA 38,32,76,70,32,32,32,32,32,32
940DATA 32,54,58,32,32,32,67,82,10,13
950DATA 9,32,32,32,32,60,32,70,56,32,62
960DATA 32,77,69,78,89,10,13,10,32,32
970DATA 32,32,84,65,83,84,32,212,78,83
980DATA 75,69,84,32,75,79,68,69,10,13
990DATA 32,46,32,32,32,32,46,32,32,32
1000DATA 32,46,33,202,129,34,228,250
1010DATA 62,42,50,172,129,201,33,243
1020DATA 127,34,228,250,62,46,50,172
1030DATA 129,201,229,197,245,33,228
1040DATA 128,241,190,202,226,129,35,35
1050DATA 245,126,254,255,194,208,129
1060DATA 241,195,228,129,35,126,193
1070DATA 225,201,0,0
0
#include <stdio.h>
#include <stdlib.h>
// BASIC keywords corresponding to tokens 0x80..0xff
const char *tokDecode[128] = {
"END", "FOR", "NEXT", "DATA", "INPUT", "DIM", "READ", "LET",
"GOTO", "RUN", "IF", "RESTORE", "GOSUB", "RETURN", "REM", "STOP",
"WIDTH", "ELSE", "LINE", "EDIT", "ERROR", "RESUME", "OUT", "ON",
"DSKO$", "OPEN", "CLOSE", "LOAD", "MERGE", "FILES", "SAVE", "LFILES",
"LPRINT", "DEF", "POKE", "PRINT", "CONT", "LIST", "LLIST", "CLEAR",
"CLOAD", "CSAVE", "TIME$", "DATE$", "DAY$", "COM", "MDM", "KEY",
"CLS", "BEEP", "SOUND", "LCOPY", "PSET", "PRESET", "MOTOR", "MAX",
"POWER", "CALL", "MENU", "IPL", "NAME", "KILL", "SCREEN", "NEW",
"TAB(", "TO", "USING", "VARPTR", "ERL", "ERR", "STRING$", "INSTR",
"DSKI$", "INKEY$", "CSRLIN", "OFF", "HIMEM", "THEN", "NOT", "STEP",
"+", "-", "*", "/", "^", "AND", "OR", "XOR",
"EQV", "IMP", "MOD", "\\", ">", "=", "<", "SGN",
"INT", "ABS", "FRE", "INP", "LPOS", "POS", "SQR", "RND",
"LOG", "EXP", "COS", "SIN", "TAN", "ATN", "PEEK", "EOF",
"LOC", "LOF", "CINT", "CSNG", "CDBL", "FIX", "LEN", "STR$",
"VAL", "ASC", "CHR$", "SPACE$", "LEFT$", "RIGHT$", "MID$", "'",
};
static int readByteVal(FILE *ifp)
{
int val;
if (fscanf(ifp, "%x", &val) != 1)
{
return -1;
}
if (val > 0xff)
{
fprintf(stderr, "\n\nERROR hex value > 0xff\n");
fclose(ifp);
exit(-50);
}
return val;
}
int main(int argc, char **argv)
{
if (argc < 2)
{
fprintf(stderr, "ERROR no filename given\n");
return -1;
}
FILE *ifp = fopen(argv[1], "rb");
if (!ifp)
{
fprintf(stderr, "ERROR couldn't open file '%s'\n", argv[1]);
return -2;
}
// I don't know why this is here - skip it
if (readByteVal(ifp) != 0x8d)
{
fprintf(stderr, "ERROR first hex value from file '%s' not 0x8d\n", argv[1]);
return -3;
}
int val = -1;
while (!feof(ifp) && !ferror(ifp))
{
// Read and discard 2 byte values -- address in memory of start of next line
if ( (val = readByteVal(ifp)) <= 0 ) // == 0 marks end of BASIC file, < 0 error
{
break;
}
if ( (val = readByteVal(ifp)) < 0 )
{
break;
}
// Read line number -- 16-bit integer
int lnLo = readByteVal(ifp);
int lnHi = readByteVal(ifp);
if (lnLo < 0 || lnHi < 0)
{
val = -1;
break;
}
int ln = (lnLo & 0x0ff) | (lnHi << 8 & 0x0ff00);
printf("%d", ln);
// Read and detokenize line contents. Line ends at a zero.
while (!feof(ifp) && !ferror(ifp))
{
if ( (val = readByteVal(ifp)) < 0 )
{
break;
}
if (val == 0) // end of line
{
printf("\n");
break;
}
else
if (val < 0x80)
{
printf("%c", val);
}
else
{
printf("%s", tokDecode[val - 0x80]);
}
}
if (val < 0)
{
break;
}
}
if (ferror(ifp))
{
fprintf(stderr, "\n\nERROR reading from file '%s'\n", argv[1]);
fclose(ifp);
}
fclose(ifp);
if (val != 0)
{
fprintf(stderr, "\n\nERROR reached end of file '%s' unexpectedly\n", argv[1]);
return -4;
}
printf("\n");
return 0;
}
1:REM' THIS PROGRAM IS MADE
2:REM'
3:REM' TO RESERVE 512 BYTES IN
4:REM'
5:REM' LOWER RAM AREA (8003H) ON 32K.
6:REM'
7:REM' IT WORK ONLY ON THE NORWAY VERSION
10CLS
20RV$=CHR$(27)+"p"
30NV$=CHR$(27)+"q"
40PRINT" ";RV$;" ** ADVARSEL! **"
50PRINT NV$;"Alle dine filer vil bli SLETTET n/r du kjANDrer dette programmet"
60PRINT @160,"Vil du g/ tilbake hovedmenyen for / ta kopi av filene dine? (J/N)
70A$=INKEY$:IF A$=""THEN 70
80IF A$="n" OR A$="N" THEN 100
90IF A$="j" OR A$="J" THEN MENU
95BEEP:CLS:GOTO 10
100PRINT"Skriv 'START' (enter) for"
110LINE INPUT "/ kjANDre programmet :";A1$
120IF A1$="start" OR A1$="START" THEN 150
130BEEP:CLS:GOTO100
150:REM' HERE START THE PROGRAM ITSELF
160BH=PEEK(64193) AND 240
170:REM' IN THE TWO NEXT LINE THE NUMBER 2
180:REM' MEANS 2 TIME 256 BYTES RESERVED
190POKE BH*256,2
200POKE 64193,BH+2
210CALL 32237
0