Tinyfpga wrote:<>
To simply be able to write an assembly program in QD, press a button and watch a small window popup on my screen would be great. I could then read the manual to try and understand what had just happened with the actual results displayed in front of me. I might even be able to modify the code to change the size of the window and thus begin to build pjw's cathedral.
I may reply to more later, but as to your wish above, it is entirely possible. This is exactly what I do.
You need FileInfo2 (FI2) for this. I sincerely hope you are acquainted with this essential utility. Then you need an assembler, linker and Make utility. If you download the SMSQ/E sources, or at least the extras directory, you get a very competent assembler and linker, namely the Qmac suit. If you balk at the idea of downloading the complete sources, you could do worse than getting the keys and mac directories too, while youre at it. But honestly, youre best off to get the whole caboodle in one fell swoop on its own "win" disk rather than pussyfooting around it or youll regret it later
Configure FI2 to use the Qmac assembler for asm files. Ive got 4 actions for asm files: Edit (QD), Assemble (nolink) [<<devn_name_ext>> -nolink -errors], Assemble (SROFF) [<<devn_name_ext>> -errors] and another variant.
QD should be configured only to use the QD/SBAS Thing for BASIC, I think it otherwise uses FI2 by default.
So thats it. To assemble a simple file (like the one below) from QD you then only need to save it and the press F10, and like Brexit, its oven ready to run!
Linking and Making is the next step. I wont say any more here and now. If you want a longer, more rambling version, there is a lot more of this on my website. Youll find a link off the toolkits page.
Now for the four-liner you asked for - in assembler:
Code: Select all
* Some Qmac directives
section code
filetype 0
* Definitions found in SMSQ/E sources
include dev8_keys_qlv
include dev8_keys_qdos_io
include dev8_keys_qdos_ioa
* Start of code
lea.l label,a1 point a1 to label below
move.w opw.con,a2 opw.con is the routine to use
jsr (a2) use it!
moveq #iow.clra,d0 CLS uses a trap
moveq #-1,d3 timeout
trap #3 do it!
lea.l message,a1 point a1 to message
move.w ut.wtext,a2 this routine writes the message
jsr (a2) go!
moveq #iob.fbyt,d0 Fetch a byte routine (BGET)
moveq #-1,d3 wait forever
trap #3
moveq #ioa.clos,d0 Close channel
trap #2
exit
rts Return to BASIC
* Data
* Three routines, which must be called in user mode, set up console
* or screen windows using a parameter list, pointed to by A1.
* In the first case, the window is opened using a name which has been
* supplied, a block of parameters defining the border, and the paper,
* strip and ink colours. The window is set up and cleared for use.
* The parameter block is as follows:
label
dc.b 255 $00 border colour (byte)
dc.b 1 $01 border width (byte)
dc.b 7 $02 paper/strip colour (byte)
dc.b 2 $03 ink colour (byte)
* For the second and third routines a further four words will
* need to be added to the parameter block to define the window:
x equ 100 Define some values
y equ 50
* Since this will be CALLed from BASIC it is dependent on BASIC's OUTLine.
* So if BASIC isnt in its usual place and hasnt its usual size, ie
* 512x256a0x0, this may not look right!
dc.w x $04 width (word)
dc.w y $06 height (word)
dc.w (512-x)/2 $08 X-origin (word)
dc.w (256-y)/2 $0A Y-origin (word)
message
dc.w endmsg-startmsg
startmsg
dc.b 'Hello World!',10
endmsg
dc.w 0 In case length is odd..
*
end
Since its not a job or a toolkit, it has to be CALLed from BASIC:
Code: Select all
10 a = ALCHP(100)
20 LBYTES 'win1_tst_simple_bin',a
30 CALL a
40 RECHP a
Of course theres a lot more going on. SMSQ/E is doing all the hard work! These are just a series of calls to system routines. Off the top of my head I cant begin to think about how to draw a single glyf on to the screen - Luckily, its all done for us! In other words: The foundations for the cathedral are already in place! The rest is up to us.