?
Solved

using basm with delphi

Posted on 2000-02-09
4
Medium Priority
?
292 Views
Last Modified: 2010-10-05
Hi, i'm trying to learn to use basm with delphi. I need a list of all the upcodes, what thay do and how to use them.
Thanks.
0
Comment
Question by:lfrodrigues
  • 3
4 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 2505138
hi,
unfortunatly its a bit more complicated than that.you need to learn asembly language first,
for that you can get some stuff here:

http://inthe.future.easyspace.com/asm/asm.html
(helppc.zip contains opcodes etc)

there are a lot of asm links here:

http://www.geocities.com/SiliconValley/2926/tp_1.html#ASM

particularly the link to Randall Hyde's Assembly Language Page, Art of ASM programming would be the best to start.

Regards Barry
0
 
LVL 17

Accepted Solution

by:
inthe earned 150 total points
ID: 2506301
A good source of code is always other graphics/maths components as they nearly always use assembler,various links for graphics/maths at
http://www.efg2.com/Lab/Library/

but really first thing is get as many good books on assembler and especially go here:
http://webster.cs.ucr.edu/Page_asm/ArtofAssembly/ArtofAsm.html


i leave some examples :

procedure WritePortB( wPort : Word; bValue : Byte );
begin
  asm
    mov dx, wPort
    mov al, bValue
    out dx, al
  end;
end;

function ReadPortB( wPort : Word ) : Byte;
begin
  asm
    mov dx, wPort
    in al, dx
    mov result, al
   end;
end;


procedure PCSpeakerBeep(Frequency, Duration: Integer);
begin
if Win32Platform = VER_PLATFORM_WIN32_NT then
Windows.Beep(Frequency, Duration)
else
asm MOV ECX, Frequency
JCXZ @@2
MOV EAX, 1193181
CDQ
IDIV ECX
MOV ECX, EAX
IN AL, ($61)
TEST AL, $03
JNZ @@1
OR AL, $03
OUT ($61), AL
MOV AL, $B6
OUT ($43), AL
@@1: MOV AL, CL
OUT ($42), AL
MOV AL, CH
OUT ($42), AL
PUSH Duration
CALL Windows.Sleep
@@2: IN AL, ($61)
AND AL, $FC
OUT ($61), AL
end;
end;
0
 
LVL 1

Author Comment

by:lfrodrigues
ID: 2507319
Does basm support all of the upcodes??
0
 
LVL 17

Expert Comment

by:inthe
ID: 2507524
no only up to about 386 ,you can get stuff for mmx but it probably not worth it unless your writing particularly for mmx.
you can also get opcode listing s from intels site,but i think helppc covers it.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…
Suggested Courses
Course of the Month6 days, 2 hours left to enroll

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question