Author Topic: Rectangle Test  (Read 2676 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Rectangle Test
« on: January 03, 2011, 10:54:30 AM »
Deleted
« Last Edit: April 11, 2015, 09:10:18 AM by Peter »

Charles Pegge

  • Guest
Re: Rectangle Test
« Reply #1 on: January 04, 2011, 05:18:42 AM »
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
Code: [Select]
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)
Code: [Select]
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

Charles Pegge

  • Guest
Re: Rectangle Test
« Reply #2 on: January 05, 2011, 05:03:07 AM »
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

Code: [Select]

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
Code: [Select]

 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