//cut and paste
'for free use with GFA Basic
'Print 1 to 10 about 3 times faster than
'regular GFA code or up to 7 times faster
'than other C api calls
'Advanced users:
//**Warning do not modify the code unless
//**you are an experienced programmer since
//**the IDE or system could crash with
//**improper coding in assembly language
OpenW 1 : ~BringWindowToTop(Win_1.hWnd)
AutoRedraw = True
PrintScroll = True
Text 30, 10, "Assembly language print loop in GFA Basic"
Global Int For_n, Next_n
For_n = 1 //print range
Next_n = 10
AsmForNextPrn(For_n, Next_n)
Function AsmForNextPrn(For_n As Int, Next_n As Int) As Int Naked
//Assembly
.For:
. push -1
. mov eax, For_n
. scall PRIEXPCR
. pop edx
. mov eax, For_n
. inc eax
. cmp eax, Next_n
. mov For_n, eax
. jg .Exit
. jmp .For
.Next:
.Exit:
EndFunc