View previous topic :: View next topic |
Author |
Message |
Lynn
Joined: 27 Aug 2004 Posts: 89
|
Posted: Mon Oct 04, 2004 10:07 am Post subject: ASM code examples available |
|
|
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 |
|
|
Rohan
Joined: 05 Jan 2007 Posts: 22
|
Posted: Sun Jan 07, 2007 11:39 am Post subject: |
|
|
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 |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Sun Jan 07, 2007 1:52 pm Post subject: |
|
|
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 |
|
|
|
|
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
|