ASM syntax in PB3.5 
Author Message
 ASM syntax in PB3.5

John, the DB mnemonic tells powerbasic to "define" (place) a specific
byte value in the code.

The &H66 prefix to many 16-bit mnemonics instructs the processor to
use the extended registers.

For example:

! DB &H66
! MOV AX, &HFF

is equivalent to:

! MOV EAX, &HFF

I hope this helps!


Quote:
>Hi,

>I want to do some inline assembly  of some 32-bit opcodes (using EAX,
>stuff like that). Since the ASM statement doesn't know how to do this,
>I just assemble the opcodes using NASM (which puts in the 66h preamble
>byte thing) and poke the assembled opcodes in Basic using

> ASM DB  xxxx

>BUT I don't really understand the DB syntax.

>!  DB  &h66
>!  DB  &hC1
>!  DB  &hE1

>seems OK, but clumsy.

>Things like

>! DB &h12, &h34

>cause errors.

>Forms like

>!  DB &h11223344AABBCC

>sometime complain that I have not entered a legal numeric variable,
>which implies that even ASM is looking for legit numeric types (ie,
>byte, word, longword, etc) which implies

>!  DB  &h66C1E1

>might NOT assemble three bytes!

>The PB docs don't seem to discuss the DB syntax.

>Any wisdom here?

>Thanks,

>John

>ps - NASM is a cool free x86 assembler!

>pps - this was posted to comp.lang.basic.powerbasic originally, but
>that ng looks pretty dead. I guess the world doesn't need *two*
>PowerBasic newsgroups.

Lance
PowerBASIC Support

-------------------------------------------------------------------------
PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.*-*-*.com/



Wed, 03 Dec 2003 12:13:51 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ASM in PB3.5

2. Implementing letrec-syntax using only let-syntax and syntax-rules

3. ASM syntax in PB DOS 3.5

4. asm syntax highlighting in Visual studio

5. Inline asm syntax (gcc)

6. Syntax error in asm using hla

7. GNU as, AT&T Syntax, 32-bit asm

8. AT&T asm syntax

9. Need Intel ASM Syntax Specifications

10. AT&T asm syntax

11. AT&T asm syntax

12. ASM tutorial with NASM syntax?

 

 
Powered by phpBB® Forum Software