Updated from original SVN.
[cake.git] / workbench / classes / gadgets / texteditor / mcc / asm / ExportFunction.Asm
bloba2bf0af7f6ea86cbe8fee39fd2c7bdf1f15d49b6
2 ; a2 = Firstline
3 ; a3 = Hook
4 ; a4 = Userdata
5 ; d4 = ExportWrap
7         IncDir  Includes:
8         Include LVO/Exec_Lib.I
9         Include Exec/Types.I
12         STRUCTURE       HookMsg,0
13                 APTR    HM_UserData
14                 APTR    HM_Contents
15                 LONG    HM_Length
16                 APTR    HM_Styles
17                 APTR    HM_Colors
18                 BOOL    HM_Highlight
19                 WORD    HM_Flow
20                 WORD    HM_Separator
21                 LONG    HM_ExportWrap
22                 WORD    HM_Last
23                 APTR    HM_data
24                 LABEL   SizeOf_HookMsg
26         STRUCTURE       LineNode,0
27                 APTR    LN_Next
28                 APTR    LN_Prev
29                 APTR    LN_Contents
30                 LONG    LN_Length
31                 APTR    LN_Styles
32                 APTR    LN_Colors
33                 BOOL    LN_Color
34                 WORD    LN_Flow
35                 WORD    LN_Separator
37         XDef    _ExportText
39 _ExportText:    movem.l d1-a6,-(sp)
41         moveq   #0,d0
42 .Iterate        clr.l   -(sp)
43         clr.w   -(sp)
44         tst.l   LN_Next(a2)
45         bne.b   .lastline
46         move.w  #1,(sp)
48         move.l  LN_Contents(a2),a0
49         sub.l   #1,LN_Length(a2)
50         move.l  LN_Length(a2),d1
51 ;       clr.b   (a0,d1.w)
53 .lastline       move.l  d4,-(sp)
54         move.w  LN_Separator(a2),-(sp)
55         move.w  LN_Flow(a2),-(sp)
56         move.w  LN_Color(a2),-(sp)
57         move.l  LN_Colors(a2),-(sp)
58         move.l  LN_Styles(a2),-(sp)
59         move.l  LN_Length(a2),-(sp)
60         move.l  LN_Contents(a2),-(sp)
61         move.l  d0,-(sp)
62         lea.l   (sp),a1
63         lea.l   (a3),a0
64         move.l  8(a0),a6
65         jsr     (a6)
66         lea.l   SizeOf_HookMsg(sp),sp
68         lea.l   (a2),a0
69         move.l  LN_Next(a2),a2
70         cmp.l   #0,a2
71         bne.b   .Iterate
73 ;       move.l  LN_Contents(a4),a0
74 ;       move.l  LN_Length(a4),d1
75 ;       move.b  #10,(a0,d1.w)
76         add.l   #1,LN_Length(a0)
78         movem.l (sp)+,d1-a6
79         rts
81 \x1a\x1a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05
82 \0M