How to start programming with assembly?

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

Re: How to start programming with assembly?

Post by Dave »

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?

Post by g0blinish »

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: 2834
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: How to start programming with assembly?

Post by RWAP »

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: 2765
Joined: Sat Jan 22, 2011 6:52 am
Location: Austin, TX
Contact:

Re: How to start programming with assembly?

Post by Dave »

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?

Post by g0blinish »

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


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

Re: How to start programming with assembly?

Post by g0blinish »

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 120 times


User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: How to start programming with assembly?

Post by pjw »

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
dont be happy. worry
- ?
g0blinish
ROM Dongle
Posts: 30
Joined: Mon Jun 22, 2015 11:54 am

Re: How to start programming with assembly?

Post by g0blinish »

Ok, I understand.


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

Re: How to start programming with assembly?

Post by Derek_Stewart »

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
Gold Card
Posts: 429
Joined: Tue Mar 11, 2014 8:00 pm
Location: Oxford, UK.
Contact:

Re: How to start programming with assembly?

Post by stephen_usher »

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 122 times


Post Reply