flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > macros & ascl

Author
Thread Post new topic Reply to topic
DC740



Joined: 01 Oct 2004
Posts: 74
Location: Argentina
DC740 07 Aug 2005, 02:52
i posted this on the other forum, but it should be only here... this is the question:
i was looking at macros.inc and i wnated to use it, but i couldn't make the program work with the "meos_app_start" casue this macro must be used after the include files section, so the program doesn't compile a working binary... it doesn't show any error, it just doesn't work... i tryed adding the memory and stack values manually but it didn't work anyway...

and about the ascl library, i changed the window create macro to make it put a caption, but i couldn't manage to make this code work
; WINDOW - Draw window
; (real syntax) window xstart,xsize,ystart,ysize,color,Caption
; (SAMPLE) WINDOW 10,10,640+8,480+24,window_Skinned

macro window arg1,arg2,arg3,arg4,arg5,arg6
{
; mov ebx,arg1*65536+arg2
; mov ecx,arg3*65536+arg4
words2reg ebx,arg1,arg2
words2reg ecx,arg3,arg4
mov edx,arg5
mov eax,0
int 0x40
;now search for the end of the string and later put the caption
xor esi,esi ;set esi to 0
mov ebx,arg6 ;copy caption to ebx
@@:
cmp ebx,0 ;compare if current char is 0
je @f ;if equal then goto @@
inc esi ;not equal so inc esi and ebx
inc ebx
jmp @b ;keep with the loop until 0 is found
@@:
cmp esi,0 ;if textlenght=0 then goto next
je @f
words2reg ebx,8,8 ;x and y
mov ecx,0xffffff ;color
mov edx,arg6 ;text
;esi = captionlenght
int 0x40
@@: ;end
}
Post 07 Aug 2005, 02:52
View user's profile Send private message Reply with quote
DC740



Joined: 01 Oct 2004
Posts: 74
Location: Argentina
DC740 07 Aug 2005, 03:15
i know i forgot to put mov eax,4 before calling the int 0x40 but i put it and it still doesn't work
Post 07 Aug 2005, 03:15
View user's profile Send private message Reply with quote
DC740



Joined: 01 Oct 2004
Posts: 74
Location: Argentina
DC740 07 Aug 2005, 18:44
now is working thanx anyway.. this is the finished code

; WINDOW - Draw window
; (real syntax) window xstart,xsize,ystart,ysize,color,Caption
; (SAMPLE) WINDOW 10,10,640+8,480+24,window_Skinned,WindowCaption

macro window arg1,arg2,arg3,arg4,arg5,arg6
{
; mov ebx,arg1*65536+arg2
; mov ecx,arg3*65536+arg4
words2reg ebx,arg1,arg2
words2reg ecx,arg3,arg4
mov edx,arg5
mov eax,0
int 0x40
;now search for the end of the string and later put the caption
mov eax,4
xor esi,esi ;set esi to 0
mov ebx,arg6 ;copy caption to ebx
@@:
cmp byte [ebx],0 ;compare if current char is 0
je @f ;if equal then goto forward
inc esi ;not equal so inc esi and ebx
inc ebx
jmp @b ;keep with the loop until 0 is found
@@:
cmp byte [esi],0 ;if textlenght=0 then goto next
je @f
words2reg ebx,8,8 ;x and y

;mov ebx,8*65536+8
mov ecx,0xffffff ;color
mov edx,arg6 ;text
;esi = textlenght
int 0x40
@@: ;end
}
Post 07 Aug 2005, 18:44
View user's profile Send private message 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.