NOOB QUESTION: learning machine code

Anything QL Software or Programming Related.
Tinyfpga
Gold Card
Posts: 252
Joined: Thu Sep 27, 2018 1:59 am

Re: NOOB QUESTION: learning machine code

Post by Tinyfpga »

I have just downloaded Easy68k in portable form so that it runs from a USB key. At first browse it seems very good.

I have two observations:- the first, is that something like this could or should be created for SMSQE and the second is that the manual is .chm form, which is all very clever but not really readable.

I want to convert the .chm file into something useful like .pdf. I have tried (not very hard) to cut and paste the pages into MS Word but the images are not copied. Does anyone know of a portable application that can convert .chm.

Some time ago I "published" norm's book on assembler in a spiral binder. I have just logged on to http://www.bookprintinguk to see if it is still available to buy. I can see that two were bought in 2020 for £10.64, which is a low price for such a large illustrated manual. The published version is an older version of the online version. I am tempted to pay to have it updated.

To buy the printed version log on to bookprintinguk with as documentsforsms@gmail.com and forsms11 as password. Go to "View All Projects" and then press "Order More". Add to Basket - Next - Change delivery address - etc. etc.


Tinyfpga
Gold Card
Posts: 252
Joined: Thu Sep 27, 2018 1:59 am

Re: NOOB QUESTION: learning machine code

Post by Tinyfpga »

I have just phoned BookPrintingUK to find out how much it would cost to update the file they have on record. The cost to me is low but during the conversation the subject of GDPR came up.

I have made public the logon details of the account and that means that a new buyer has access to the last purchaser's details unless that person alters the account details after purchasing . Account details can easily be changed and I have just created a fictional address for the account. Buyers can put in their details, buy the book and then change the details back to the fictional address.

This way of "publishing-on-demand" provides for very low cost book production and delivery but is not what BookPrintingUK was setup to do.
It is not certain that they will tolerate large numbers of individual buyers accessing an account and altering the account details for each purchase .

Luckily no one is interested in printed QL documentation and only five of Norm's manual have been bought to date. There were just two buyers for the five manuals.


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: NOOB QUESTION: learning machine code

Post by NormanDunbar »

CHM converters on and offline, from CHM to Word Doc, here: https://duckduckgo.com/?q=convert+chm+t ... doc&ia=web

There's an eBook program called Calibre, which might be useful too. It handles many formats. It's at https://calibre-ebook.com/

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: NOOB QUESTION: learning machine code

Post by NormanDunbar »

Derek_Stewart wrote:HI,

Why not read Norman's Assembley Magazine, really good read for upto date QL assembley language.
So far, there are 9 issues. The first is in a different layout from the other 8. Not all, yet, have code files included -- that was added for more recent issues due to a request from a reader.

If you go to https://github.com/NormanDunbar/QLAssem ... e/releases then you can click to open the assets list for each issue and download the pdf file. If there is a code file, grab that as well to save you typing. However, it's better, in my opinion, to type stuff in.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
TMD2003
Trump Card
Posts: 168
Joined: Sat Oct 10, 2020 12:18 pm

Re: NOOB QUESTION: learning machine code

Post by TMD2003 »

That's a lot of helpful suggestions and I will take them on board, but this could be the jackpot:
tofro wrote:One thing that is really advisable before you start torturing the real thing is Easy68k, a CPU simulator that was originally created to help teach students 68k machine code. Obviously, you will not be able to work with QDOS, but the first steps are way easier than on the real QL (or even an emulator).
I won't need to operate QDOS via machine code - most of what I do will still be in SuperBASIC, it's a few little manipulations. Easy68K looks like the 68000's equivalent of the code-simulator that comes with New Generation's Complete Machine Code Tutor for the Spectrum; that was invaluable in getting my first few faltering steps with Z80 machine code to work.

Even if there's only the equivalent of a few LDs and loops to start with, that'll be the way I'm looking for to see it working without having to assemble, watch the crash, reassemble, and so on...


Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: NOOB QUESTION: learning machine code

Post by Derek_Stewart »

Hi,

Here is the converted Easy68K Help files in PDF and Epub formats:
Easy68K_Help.zip
Easy68K Help Files in PDF and Epub FOrmat
(1.54 MiB) Downloaded 68 times
Also please look at Norman's Assembley Language Magazine vol 1

Also look at the SMSQ/E sources, for a definitive way to write 68K assembley language
https://www.wlenerz.com/smsqe/


Regards,

Derek
Tinyfpga
Gold Card
Posts: 252
Joined: Thu Sep 27, 2018 1:59 am

Re: NOOB QUESTION: learning machine code

Post by Tinyfpga »

Thanks for doing that, Derek.
The first thing I did when learning to write a BASIC program was to create a window in which to display the results of my experiments. (And I don't mean writing to a window of the user interface). I find I need to "see" the results of my programming efforts immediately otherwise I rapidly lose interest. This is the problem with the IDEs that come with my Pi400.
I have not been able to just create a stand alone app that is merely a window that does nothing, with any of the tools that come with the Pi400 standard setup. This discourages me.

I have a feeling I have asked this question in an earlier post but here goes (again?). How do you write a program in assembly and execute it in the the following way:-

In Basic all I have to do start my journey into the programming world is to:-
Type into QD

Open #1,con_
Outln #1,310,60,50,300
Cls #1 : Border #1,1,7
Input #1,a$

I then save the text in a ram disk, press the execute button and ,"hey presto", I see an app on my screen. What could be an easier introduction to programming?

(I have just tried to do this in the Pi400's Mu. It does absolutely nothing of interest. Am I going to persist with this ? The answer is no.)

I am sure one can create a window in assembly using QD. Type some assembly code save to ram disk, press a button to assemble and execute. Straight away one can see the source code and the result of executing that code at the same time. One can then possibly begin to understand the relationship between the two.

This might be an attractive and thus more interesting introduction to assembly language programming.

Is anyone able to write the assembly equivalent of the BASIC code above and tell me how to set up a QD/assembler thing to execute it?
Last edited by Tinyfpga on Sun Nov 21, 2021 12:07 pm, edited 1 time in total.


Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: NOOB QUESTION: learning machine code

Post by Derek_Stewart »

Hi,

There is a file suppled with QD called QDasm_rext. This allows QD to assemble a assembleu language file by pressing the F10 key to load the QDasm Thing this loafs the QMAC assembler to compile the assembley file in QD. Note this only works on single page files.

More details in the QD manual.

For multiple page assembley files, QMAKE or Make would have to be used.

The assembley language example can be written after reading Norman's QL Assembley Magazine vol 1.


Regards,

Derek
Tinyfpga
Gold Card
Posts: 252
Joined: Thu Sep 27, 2018 1:59 am

Re: NOOB QUESTION: learning machine code

Post by Tinyfpga »

Thanks for the info Derek. When I find the time I will concentrate on setting up an assembler/QD as you suggest. I downloaded Norm's magazine and scanned though the pages and quickly realised that I would really have to work hard to understand what is being written. Like many subjects there is a "river of knowledge" I need to cross.

I found the following on the internet titled "Curse of Knowledge":- ( I changed the you to one for the sake of politeness)

"When one gets to know a concept well, one forget what it's like to not know it. This affects the way one communicates,instructs and teaches it to others."

I find this is certainly true for me. Actually it's worse for me. I run a small building restoration company and I know stuff (not much but a lot more than many of the sub-contactors I employ). I can easily become annoyed at the lack of knowledge expressed by those I employ and the cost of dealing with it. I try and impart my knowledge by example. This seems to work because I demonstrate that I can actually do what I am talking about, and that the doing is doable by others.

I mentioned that I thought I had asked the question posted above, in an other post. This morning I found that I had done so and that pjw had kindly replied with an assembly example:- viewtopic.php?f=3&t=2839&start=110#p44063
Last edited by Tinyfpga on Sun Nov 21, 2021 1:02 pm, edited 2 times in total.


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: NOOB QUESTION: learning machine code

Post by tofro »

Tinyfpga wrote:
"When one gets to know a concept well, one forget what it's like to not know it. This affects the way one communicates,instructs and teaches it to others."
That relates pretty well to what I wrote in another place about you have to forget everything you know when you want to write a good manual. It's hard to recall the moment where all the puzzle pieces "clicked together" and the enlightning happened.

With assembly, I guess it's a bit different: It's really like Norman said "much easier than SuperBASIC" - It's just that most people apparently cannot imagine how primitive assembly language actually is.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply