Pl2 CORRIG 3.DOC
EXERCISE CORRECTIONS
on LineAs
---------
1) Exercise nr° 1:
-------------- Here is the correction listing. I think this exercise didn't cause you much trouble, carefully look at this listing, it doesn't have any difficulty.
TEXT
INCLUDE "LINEQU.L" ;the EQUs INCLUDE "INIT_TOS.L" ;Setblock INCLUDE "MACROS.L" ;The macros
SETBLOCK ;Initialization
- We search for the address of the internal Table for the LineAs
DC.W $A000 ;return in a0 of the address ;of the internal table
- We drop the addresses of the VDI array tables in the internal table
move.l #CONTROL,ticontrol(a0) move.l #INTIN,tiintin(a0) move.l #PTSIN,tiptsin(a0) move.l #INTOUT,tiintout(a0) move.l #PTSOUT,tiptsout(a0)
PRINTLINE MOUSE ;text WAIT ;waiting
lea INTIN,a6 ;address of INTIN in a6
move #0,6(a6) ;0 in intin+6 (mask color) move #1,8(a6) ;1 in intin+8 (foreground color)
lea DATA,a5 ;address of 'DATA' in a5
move #31,d0 ;31 in d0 adda.l #10,a6 ;increment a6 by 10 units: ;a6 therefore points on intin+10
LOOP move (a5)+,(a6)+ ;we drop the data in
;the INTIN table pointed by ;a6 dbf d0,LOOP ;we loop 32 times for the ;32 data (16 words for the ;mask and 16 words for the ;foreground)
DC.W $A00B ;TRANSFORM MOUSE
move #0,intin ;counter=0 DC.W $A009 ;SHOW MOUSE
PRINTLINE MESSAGE ;text WAIT ;waiting TERM ;end
DATA
MOUSE DC.B 27,'E','I change the shape of the mouse cursor...'
DC.B ' mouse ...',0
MESSAGE DC.B 27,'E','Move the MOUSE please ...',7,0
DATA DC.W %0000001110000000 ;the 16 data (WORDS)
DC.W %0000011111000000 ;of the MASK [...] (omission of repeated patterns) DC.W %0000001110000000
DC.W %0000000000000000 ;the 16 data (WORDS) DC.W %0000001110000000 ;of the FOREGROUND [...] (omission of repeated patterns) DC.W %0000000000000000
BSS
INCLUDE "TABLEAU.L" ;the VDI table
END
2) Exercise nr°2:
-------------- Again, no major difficulty... Just needed to be careful to use graphical coordinates that match the used resolution.
(OX)=640 from 0 to 339 (OY)=200 from 0 to 199 (MEDIUM resolution)
TEXT
INCLUDE "LINEQU.L" ;the EQUs INCLUDE "INIT_TOS.L" ;Setblock INCLUDE "MACROS.L" ;The macros
[...] (Rest following the same logic of translation and code structure)
3) Exercise nr°3:
-------------- Here is the listing of the program that draws a rectangle with a PAT redefined after having loaded the previous grid program.
[...] (The rest following the same logic of translation and code structure)
4) Exercise nr° 4:
---------------
[...] (The rest following the same logic of translation and code structure)
5) Exercise nr°5:
-------------- Here is the listing of the program displaying points of different colors on the screen.
[...] (The rest following the same logic of translation and code structure)
6) Exercise nr°6:
-------------- Here is the corrected program that displays diamonds without and then with CLIPPING...
[...] (The rest following the same logic of translation and code structure)
------------------
That's it for the corrections of the exercises on LineAs...
The listings of these 6 programs as well as the executable programs are of course on this disk in the files:
1) TRANSMOU.L & TRANSMOU.PRG 2) CADRE .L & CADRE .PRG 3) RECTANGL.L & RECTANGL.PRG 4) SPRITE .L & SPRITE .PRG 5) POINT .L & POINT .PRG 6) POLYGONE.L & POLYGONE.PRG
Laurent PIECHOCKI 8,Impasse Bellevue Continue in the file: INTERRUP.DOC 57980 TENTELING ------------
Back to ASM_Tutorial