Oxygen Basic
Programming => Example Code => Topic started by: Peter on January 03, 2011, 10:54:30 AM
-
Deleted
-
Hi Peter,
I like the moving figures :)
I got 2 seconds on the rectangle test but first I had to fix 2 typos to get the examples to work.
In Lib_G: closing bracket on the circle function
Function Circle(byval hdc as long byval x0 as long, byval y0 as long, byval rad as long, byval col as long)
in the first example you put ] instead of l)
Function AsmBox(byval hdc as long, byval x5 as long, byval y5 as long, byval x6 as long, byval y6 as long, byval bCol) as long 'was ]
And I will look at your asm problem ASAP.
Charles
-
Hi Peter,
The o2 assembler is unwilling to push/pop 16 bits. - I can fix this behaviour. A simple workaround is to put in a data size prefix in a line preceding the push/pop:
o2 66
push eax
o2 66
pop eax
I have checked the encoding against the Intel Manual and it all appears valid.
However the main problem is that the system does not allow access into this area, not for the unpriviledged anyway.
Do you agree with this?
Charles
Function FlushKey()
push gs
push eax
mov ax,0
mov gs,ax
pop eax
mov ax,gs:[0x041A] 'Head
mov gs:[0x041C],ax 'Tail
pop gs
End Function
Encoding
E9 gf _endp ' jmp fwd _endp
!10 '
.flushkey ' .flushkey '
( ' (
0F A8 ' push gs
50 ' push eax
66 C7 C0 00 00 ' mov ax,0
8E E8 ' mov gs,ax
58 ' pop eax
65 66 8B 04 25 1A 04 00 00 ' mov ax,gs: [0x041A] 'Head
66 65 89 04 25 1C 04 00 00 ' mov gs: [0x041C],ax 'Tail
0F A9 ' pop gs
.end_proc ' .end_proc
.end_return ' .end_return
C3 ' ret
) ' )
._endp ' ._endp