How to access labels in PB/DLL 
Author Message
 How to access labels in PB/DLL

I'm wondering why the following code doesn't work in pbdll 5, for some
reason pb doesn't let me accessing labels.

  Thanks in advance jasper

FUNCTION X

  ASM lea edi,Label
  ASM mov ax,es:[edi]
  ASM mov A,ax

  MSGBOX STR$(A)

  EXIT FUNCTION
Label:
  ASM dw 100
END FUNCTION



Thu, 15 Aug 2002 03:00:00 GMT  
 How to access labels in PB/DLL
Label is a keyword...
'Control Add Label'

On Sun, 27 Feb 2000 21:05:04 +0100, Jasper

Quote:

>I'm wondering why the following code doesn't work in pbdll 5, for some
>reason pb doesn't let me accessing labels.

>  Thanks in advance jasper

>FUNCTION X

>  ASM lea edi,Label
>  ASM mov ax,es:[edi]
>  ASM mov A,ax

>  MSGBOX STR$(A)

>  EXIT FUNCTION
>Label:
>  ASM dw 100
>END FUNCTION



Thu, 15 Aug 2002 03:00:00 GMT  
 How to access labels in PB/DLL
"Label" is only a keyword in PB/DLL 6+ which has the DDT stuff. the question
was on PB/DLL 5.0

However, EVEN IF THIS WERE PB DLL 6.0, IT IS A CRIME THAT 'LABEL' IS A
KEYWORD OTHER THAN IN A 'CONTROL ... LABEL ..' STATEMENT.

(I've griped about this before, with "handle").

--
Michael Mattias
Racine WI USA

Quote:

>Label is a keyword...
>'Control Add Label'



Fri, 16 Aug 2002 03:00:00 GMT  
 How to access labels in PB/DLL

Quote:

> Label is a keyword...
> 'Control Add Label'

> On Sun, 27 Feb 2000 21:05:04 +0100, Jasper

> >I'm wondering why the following code doesn't work in pbdll 5, for some
> >reason pb doesn't let me accessing labels.

> >  Thanks in advance jasper

> >FUNCTION X

> >  ASM lea edi,Label
> >  ASM mov ax,es:[edi]
> >  ASM mov A,ax

> >  MSGBOX STR$(A)

> >  EXIT FUNCTION
> >Label:
> >  ASM dw 100
> >END FUNCTION

Thanks for your answer but maybe I wasn't clear enough for you to
understand my real question :-(
The sub is the core of a z80 emulator. 'Label' was just a label which could
have had any name. The sub cycles, gets an opcode, translates it.
The translator( included select case ) uses the Reg_xx labels for storing
the emulators registers. The problem is that I'm not able to access these
label from my program.
Maybe powerbasic miscompiles this somehow. I always use this way in PB dos
and I've never had any problems there. I tried any possible asm ways. None
worked.
And btw, Control is not a valid pbdll 5 statement, Is it for resources?

nb: With accessing I mean:
  ASM mov word ptr Reg_BC,ax
or
  ASM lea edi,Reg_BC
  ASM mov es:[edi],ax
or
  ASM mov cs:[edi],ax

This pseudo code is what my program does.

SUB Cycle

DO
  Get Opcode
  Translate Opcode

LOOP

EXIT SUB

Reg_BC:
Reg_C:
  ASM db 0
Reg_B:
  ASM db 0
  ASM dw 0

Reg_DE:
Reg_E:
  ASM db 0
Reg_D:
  ASM db 0
  ASM dw 0

Reg_HL:
Reg_L:
  ASM db 0
Reg_H:
  ASM db 0
  ASM dw 0

Reg_AF:
Reg_F:
  ASM db 0
Reg_A:
  ASM db 0
  ASM dw 0

END SUB

--



Fri, 16 Aug 2002 03:00:00 GMT  
 How to access labels in PB/DLL
You can skip this message. I already have the answer.
Protected mode doesn't let me write to the code segment.

Thanks support!



Fri, 16 Aug 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. SQL, ADO/OLE-DB programming in PB/DLL and PB/CC

2. animated characters, speech input/output in PB/DLL and PB/CC

3. email enable PB/DLL-PB/CC using Outlook

4. Info on new PB/CC and PB/DLL

5. Announcing the JazzAge COM Wizard for PB/DLL and PB/CC

6. MX Lookup with PB/CC or PB/DLL

7. TCPADDR for PB/DLL & PB/CC

8. PB DLL's for Visual Basic

9. PB/DLL's and Windows NT

10. add support for COM and OCXs to PB/DLL-CC

11. PB/DLL 6.0 - PBEDIT Bug found...

12. OCX/COM support in PB/DLL

 

 
Powered by phpBB® Forum Software