Fresh IDE . Check-in [30f1444ddb]
Not logged in

This repository is a mirror!

The original is located on: https://fresh.flatassembler.net/fossil/repo/fresh
If you want to follow the project, please update your remote-url

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Work on the test project for the bbcode parser.
Timelines: family | ancestors | descendants | both | FreshLibDev
Files: files | file ages | folders
SHA1:30f1444ddb1bb7d885a4a99b68348b7b0508e7d5
User & Date: johnfound 2018-10-17 12:01:37
Context
2018-10-17
12:03
Work on the new Exec2 function for Linux that allows changing of the std i/o handles. It is implemented in _process_posix.asm, but uses only system calls and the same implementation will be OK for the _process_native.asm; check-in: f828bb2bc5 user: johnfound tags: FreshLibDev
12:01
Work on the test project for the bbcode parser. check-in: 30f1444ddb user: johnfound tags: FreshLibDev
12:00
Work on the bbcode parser and adapting the MiniMag parser to the new interfaces. check-in: 058c531ade user: johnfound tags: FreshLibDev
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to freshlib/test_code/TestBBCode/bbcode.asm.

15
16
17
18
19
20
21

22
23
24
25
26
27
28
29
30
31
32
33





34
35
36
37
38
39
40
..
48
49
50
51
52
53
54



55














56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
include "%lib%/freshlib.inc"

@BinaryType console, compact

options.DebugMode = 0
options.ShowSizes = 1


include "%lib%/freshlib.asm"

include "hash_function.asm"


FILE_READ_CHUNK = 4096

rb 237

start:
        InitializeAll







        stdcall TextCreate, sizeof.TText
        mov     edx, eax

.read_loop:
        stdcall TextMoveGap, edx, -1
        stdcall TextSetGapSize, edx, FILE_READ_CHUNK
................................................................................
        jz      .translate

        add     [edx+TText.GapBegin], eax
        jmp     .read_loop

.translate:




        stdcall TranslateBBCode, edx














        stdcall TextCompact, edx

        stdcall FileWrite, [STDOUT], cPrefix, cPrefix.length
        stdcall FileWriteString, [STDOUT], edx

.finish:
        push    eax
        FinalizeAll
        stdcall TerminateAll ; from the stack

iglobal
  cPrefix file "prefix.tpl"
  .length = $ - cPrefix
          dd 0
endg









>












>
>
>
>
>







 







>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>


|
|













15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
..
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
include "%lib%/freshlib.inc"

@BinaryType console, compact

options.DebugMode = 0
options.ShowSizes = 1

EMOTICONS_PATH equ './'
include "%lib%/freshlib.asm"

include "hash_function.asm"


FILE_READ_CHUNK = 4096

rb 237

start:
        InitializeAll

        or      ecx, -1
        shr     ecx, 3
.hot:
        dec     ecx
        jnz     .hot

        stdcall TextCreate, sizeof.TText
        mov     edx, eax

.read_loop:
        stdcall TextMoveGap, edx, -1
        stdcall TextSetGapSize, edx, FILE_READ_CHUNK
................................................................................
        jz      .translate

        add     [edx+TText.GapBegin], eax
        jmp     .read_loop

.translate:

        stdcall GetFineTimestamp
        push    eax

        stdcall TranslateBBCode, edx, 0

        stdcall GetFineTimestamp
        pop     ecx
        sub     eax, ecx

        stdcall NumToStr, eax, ntsDec or ntsUnsigned
        push    eax eax

        stdcall FileWriteString, [STDERR], 'TranslateBBCode time: '
        stdcall FileWriteString, [STDERR] ; from the stack
        stdcall StrDel ; from the stack
        stdcall FileWriteString, [STDERR], <txt ' us', 13, 10>


        stdcall TextCompact, edx

;        stdcall FileWrite, [STDOUT], cPrefix, cPrefix.length
;        stdcall FileWriteString, [STDOUT], edx

.finish:
        push    eax
        FinalizeAll
        stdcall TerminateAll ; from the stack

iglobal
  cPrefix file "prefix.tpl"
  .length = $ - cPrefix
          dd 0
endg