flat assembler
Message board for the users of flat assembler.

flat assembler > Test Area > test it man

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4180
Location: 2018
ImageImageImageImageImageImageImage
bonjour
au revoir
ImageImageImageImage
edfed wrote:

Function list
The function list add an indirection to the calling convention, and gives the hability to manage sets of functions.

There can be many function lists in a project.
ImageImageImage
Some implementations don’t need a function list, it is up to the programmer to choose the presence of this list.

Code:
WINDOWED equ 1
TRANSPARENCY equ 220
NOBORDER equ 1
include 'sys/foolg.inc'
WX=500
WY=100
WXL=400
WYL=700+TITLEBAR_YL

fontUtil:
        APPLICATION 0,0,WXL,WYL,"font util © edfed ® 2019"

        Gnode 0,0,WXL,WYL,dispChar,dispFont

dispFont:
        Node .t2,.b;,.t
.t2:    Vtxt 10,10,0,0,White,.txt,2,ugly
.b:     Box 0,0,WXL,WYL,Black
.txt:   db '.',1,2,3,4,5,6,7
        db 8,'.','.',11,12,'.',14,15
        db CRLF
        ..n = 16
        repeat 15
         repeat 16
          db ..n+%-1
         end repeat
         db CRLF
         ..n = ..n + 16
        end repeat
        db 0

.t:     dd 0
        Asm @f
.a:     db 2
@@:
        mov al,[.a]
        add byte[transparency],al
        jne @f
        sub byte[transparency],al
        neg byte[.a]
@@:
        ret

dispChar:
        Gnode 10,500,0,0,.c,.f,.cf,.txt,.but,.over,.a
.but:   But 0,0,6*16-1,9*16-1,0,.tb,.select
.txt:   Txt 0,0,0,0,Silver,dispFont.txt,font85
.tb:    Frame 0,0,6,9,Yellow
.tf:    Frame 0,0,6,9,Lime
.cf:    Box 150,0,10*8,15*8,Green
.f:     Frame 150,0,12*8,15*8,Red
.c:     Vtxt 158,8,0,0,White,.char,8,ugly

.char:  db 9,0

.over:
        Zone 0,0,6*16-1,9*16-1,next
        Node .tf,next
        Asm next

        ;.tf.x = ((edi.x-mouse.x)/6) * 6

        mov eax,[mouse+box.x]
        sub eax,[edi+box.x]
        cdq
        mov ebx,6
        idiv ebx
        mov ecx,eax
        imul eax,ebx
        mov [.tf+frame.x],eax

        ;.tf.y = ((edi.y-mouse.y)/9) * 9

        mov eax,[mouse+box.y]
        sub eax,[edi+box.y]
        cdq
        mov ebx,9
        idiv ebx
        mov ch,al
        imul eax,ebx
        mov [.tf+frame.y],eax
        mov [.selector],ecx

        ret
.selector:
        dd ?
.select:
        Asm next
        mov eax,[.selector]
        shl ah,4
        add al,ah
        ;.char = (.selector.highbyte) << 4 + (.selector.lowbyte)
        mov [.char],al
        ret

.a:     ;Timer 10,next
        Asm next
;        inc byte [.char]

        push eax ebx
        movzx eax,byte[.char]
        mov ebx,eax
        and eax,0fh
        shr ebx,4
        imul eax,6
        imul ebx,9
        ;.tb.x = (.char && 0fh) * 6
        ;.tb.y = (.char >> 4) * 9
        mov [.tb+txt.x],eax
        mov [.tb+txt.y],ebx

        movzx eax,byte[.char]
        mov eax,[ugly+eax*4] ;char adress in list
        movzx ebx,byte[eax];size of char in char
        movzx ebx,byte[ebx+eax+1];offset of char in char
        shl ebx,3
        jg @f
        mov ebx,1
@@:
        ;.cf.xl = (ugly[char].xl)<<3
        mov [.cf+frame.xl],ebx
        pop ebx eax

        ret
    



Image


















































































































Image

_________________
Smile fool iem.design
Post 19 Feb 2019, 12:12
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.