PDA

View Full Version : نحوه ی اجرای کد (hla.)



Arcsinos
پنج شنبه 23 دی 1389, 11:39 صبح
سلام
میخواستم ببینم کد زیر که فرمتش hla. هست رو تو چه برنامه ای میشه اجرا کرد . کد زیر یه کد به زبان اسمبلیه :

program DemoMOVaddSUB;

#include( "stdlib.hhf" );

static
i8: int8 := -8;
i16: int16 := -16;
i32: int32 := -32;

begin DemoMOVaddSUB;

// First, print the initial values
// of our variables.

stdout.put
(
nl,
"Initialized values: i8=", i8,
", i16=", i16,
", i32=", i32,
nl
);

// Compute the absolute value of the
// three different variables and
// print the result.
// Note, since all the numbers are
// negative, we have to negate them.
// Using only the MOV, ADD, and SUB
// instruction, we can negate a value
// by subtracting it from zero.

mov( 0, al ); // Compute i8 := -i8;
sub( i8, al );
mov( al, i8 );

mov( 0, ax ); // Compute i16 := -i16;
sub( i16, ax );
mov( ax, i16 );

mov( 0, eax ); // Compute i32 := -i32;
sub( i32, eax );
mov( eax, i32 );

// Display the absolute values:

stdout.put
(
nl,
"After negation: i8=", i8,
", i16=", i16,
", i32=", i32,
nl
);

// Demonstrate ADD and constant-to-memory
// operations:

add( 32323200, i32 );
stdout.put( nl, "After ADD: i32=", i32, nl );



end DemoMOVaddSUB;

xman_1365_x
پنج شنبه 23 دی 1389, 13:30 عصر
hla(high level assembler)

لينك هاي زير رو ببين
http://barnamenevis.org/showthread.php?240620-High-Level-Language-%DB%8C%D8%A7-%D9%87%D9%85%D9%88%D9%86-HLA
http://barnamenevis.org/showthread.php?3815-High-Level-Assembly