How to start programming with assembly?

Anything QL Software or Programming Related.
User avatar
Dave
SandySuperQDave
Posts: 2411
Joined: Sat Jan 22, 2011 6:52 am
Location: Austin, TX
Contact:

Re: How to start programming with assembly?

Postby Dave » Sat May 05, 2018 4:59 pm

dex wrote:
g0blinish wrote:Acording these book there are two screens 0 at $20000, 1 at $28000. How to swithc screens?


See this (it uses two VRAMs):
https://github.com/SinclairQL/dithVide


Thanks for the rabbit hole...

It turns out when you said "VRAMs" you meant "screen areas" and not actual VRAMs, which is a hardware component.

I did learn a few things though - after about 40 pages.... :D

One was... Rich Mellor is a highly competent assembly programmer.


g0blinish
ROM Dongle
Posts: 30
Joined: Mon Jun 22, 2015 11:54 am

Re: How to start programming with assembly?

Postby g0blinish » Sat May 05, 2018 5:39 pm

is ql2k good for emulation?

program runs so fast.

one thing confuses me:

Code: Select all

sv_base           equ $28000        system vars base
nm_lins           equ $0fa          mixed mode settings
ln_wait           equ $0006           "    "      "
bg_wait           equ $02d7           "    "      "
sv_plist          equ sv_base+$3c   interrupt polled linked list 50/60Hz

...
lnk_flip lea      flipper,a0        ;Link element =next,vector
         movea.l  modes(pc,d1.w),a2 ;Select vector =modes[d1]
         move.l   a2,4(a0)          ;Fill in vector address


vector at screen#1?


RWAP
RWAP Master
Posts: 2613
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: How to start programming with assembly?

Postby RWAP » Sat May 05, 2018 7:16 pm

Dave wrote:One was... Rich Mellor is a highly competent assembly programmer.


Eh? What did I do to deserve this accolade?


User avatar
Dave
SandySuperQDave
Posts: 2411
Joined: Sat Jan 22, 2011 6:52 am
Location: Austin, TX
Contact:

Re: How to start programming with assembly?

Postby Dave » Sun May 06, 2018 12:31 am

RWAP wrote:
Dave wrote:One was... Rich Mellor is a highly competent assembly programmer.


Eh? What did I do to deserve this accolade?


You ever read a bit of someone else's code and think it through a little bit and go "yeah, that's really clean and efficient, and it prioritizes what it needs to!"

Also, the generosity of it. Not many people make informative suggestions on github, and even fewer write specimen code that's already optimized...


g0blinish
ROM Dongle
Posts: 30
Joined: Mon Jun 22, 2015 11:54 am

Re: How to start programming with assembly?

Postby g0blinish » Mon May 07, 2018 7:45 am

How to build job?
I include header to source, QMAC produce binary, cannot exec file.
Attachments
KL_bin.zip
(605 Bytes) Downloaded 34 times


g0blinish
ROM Dongle
Posts: 30
Joined: Mon Jun 22, 2015 11:54 am

Re: How to start programming with assembly?

Postby g0blinish » Mon May 07, 2018 10:14 am

ok, I understand.

header for binary:

Code: Select all

         filetype 0

         section code

         bra.s j_s
         dc.l 0
         dc.w $4AFB
         dc.w 6
         dc.b 'KALEID'
j_s


Convert:

Code: Select all

10 a=ALCHP(339)
20 LBYTES win3_kl_bin,a
30 SEXEC win3_kl_bin,a,339,4096
40 RECHP a


seems it works.
Attachments
KL_bin.zip
(428 Bytes) Downloaded 33 times


User avatar
pjw
Super Gold Card
Posts: 526
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: How to start programming with assembly?

Postby pjw » Mon May 07, 2018 11:53 am

I dont know what your code does, but its probably worth mentioning that it isnt a good idea to turn the dithVide code into a job. It links a task into one of the task lists, and when the job is removed, so is the memory that the code is running in! Such tasks should be loaded with LBYTES etc. A job, or a S*BASIC program, could then use its services. Check out the difference between tasks and jobs in the Technical Manual, if you need info on this.


Per
Be wary of large West-Coast corporations bearing gifts!
- Ancient Trojan proverb
Derek_Stewart
QL Wafer Drive
Posts: 1392
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: How to start programming with assembly?

Postby Derek_Stewart » Wed May 09, 2018 10:00 am

Hi,

If you use Minerva, with the Second Screen enabled, there is no need to worry about the position of the Systems Variable. You just need to use the MT.INF management Trap to return the address of the System Variable in Register A0.

In Minerva there is a fast memory move vector routine: MM.MOVE, where all the hard work is done with transferring the large blocks of data. See Minerva Manual for details.

In about 1993, I wrote some Minerva Superbasic commands to Switch the contents of Screen 0 to Screen 1, Clear the Second Screen. I think it was put up for download on my BBS, but never really saw the light of day.

I will have to re-visit it to see if the routines can be enhanced.

Minerva is the best QL operating system on a BBQL, with features like faster graphics, without Lightning, Multitasking basic... to name some excellent features.

I used to to use QMAC assembler, which was very good, with its macro processing.


Regards,

Derek
stephen_usher
Chuggy Microdrive
Posts: 69
Joined: Tue Mar 11, 2014 8:00 pm

Re: How to start programming with assembly?

Postby stephen_usher » Thu May 10, 2018 7:54 pm

A long time ago, in a galaxy far, far away...

I started programming on the QL using the Computer One assembler/editor/monitor suite plus the "QL Advanced User Guide" from Adder Publishing. They were both fine for the job. I know that the C1 stuff has been preserved but I don't know where you can get the book.

I wrote a terminal emulator which emulated the University College London BBC Micro terminal emulator which was ubiquitous there at the time. This itself emulated a DEC VT52 and Tektronix T4010 terminal, plus being about to run *FX commands to program the function keys etc. It's a pity the poor keyboard processor couldn't keep up with even 300 baud without dropping input. Oh well, happy days.
Attachments
terminal-3-53.zip
Terminal Emulator Version 3.53g (1989/12/01)
(22.5 KiB) Downloaded 37 times



Who is online

Users browsing this forum: No registered users and 4 guests