FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ASM code examples available

 
Post new topic   Reply to topic     Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Mon Oct 04, 2004 10:07 am    Post subject: ASM code examples available Reply with quote

http://dsource.org/tutorials/index.php?show_example=127
Basic asm code to split ubyte into low and high nibbles. Demonstrates reference to local numeric variables.

http://www.dsource.org/tutorials/index.php?show_example=128
Asm code that is more or less equivalent to std.string.find. Roughly similar to C-RTL strchr. Finds first occurrence of a single letter in a string. Demonstrates reference to char[] local variable, and also repne and stasb.
Caveats:
* rusty 486-asm programmer
* no error checking
Back to top
View user's profile Send private message
Rohan



Joined: 05 Jan 2007
Posts: 22

PostPosted: Sun Jan 07, 2007 11:39 am    Post subject: Reply with quote

this links is dead?
I've got error "No handler matched request to /tutorials/index.php"

How use inline assembler ?

Code:

import std.stdio;
void main();
   asm {
 xor ax,ax
int 16h
}


error Declaration expected, not 'asm'
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Sun Jan 07, 2007 1:52 pm    Post subject: Reply with quote

Rohan wrote:
this links is dead?
I've got error "No handler matched request to /tutorials/index.php"
Sorry about the links going dead, but we changed the way the examples were stored a while back. All of the old examples were put into the newer wiki-based system, but the links changed names.


http://www.dsource.org/tutorials/index.php?show_example=127 is now known as: SplittingUbyteWithAsmExample

http://www.dsource.org/tutorials/index.php?show_example=128 is now known as: FindingFirstLetterWithAsmExample



Quote:
How use inline assembler ?

Code:

import std.stdio;
void main();
   asm {
 xor ax,ax
int 16h
}


error Declaration expected, not 'asm'


I don't know much about assembly language (or embedded assembly language in D), but I don't think you're allowed to directly call an interrupt ("int 16h") in recent versions of Windows.

Here's a basic embedded assembly example that I got to work:
AsmExample
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group