To start getting familiar with the assembler and the nuances of QDOS I thought I'd try modifying (for GST/qmac) the Andrew Pennell program to print d1.l as hex. It appears here (cut and paste has slightly affected the formatting):
Code: Select all
TITLE First QL gst/qmac program
MT.FRJOB equ $05
Base bra.s Start
dc.w $06 Length of program name
dc.b 'ASSTST' Program name
move.l #$12aa34cc,d1 Test number to print
moveq #MT.FRJOB,d0 End program
* Print d1.l as hex
PrtHex moveq #7,d0
Phlp rol.l #4,d1
Phdig add.b #'0',d1
* Char to print in d1.b
CPrint movem.l d0-d1/d3/a0-a1,-(a7)
movea.l #$00010001,a0 Channel #1 remains open
My problem is twofold.
First, the above program (compiled under Qemulator), runs fine on my real hardware but freezes when I attempt to run it using Qemulator. If I comment out the trap #3 of the IO.SBYTES routine the program will at least run to completion.
Secondly, I tried running the program under Qmon. Again that works on real hardware but freezes without even producing a register display under Qemulator.
Though it would be nice to have, I can see why Qmon might not work under emulation (competition over exceptions etc) but I'm puzzled why Qemulator won't run the simple hex print program. Perhaps I haven't read the right manual yet and I'm missing some QDOSy thing or have otherwise blundered in a spectacular way (e.g. do I, for example, need to allocate some heap space for a7)?