Asm/es: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Asm/es
| Old | New | Line | |
|---|---|---|---|
| 1 | + | La palabra reservada ASM forma parte del ensamblador en línea. Introduce una sección con código de ensamblado en el código Pascal. | |
| 2 | + | ||
| 3 | + | Ejemplo de cómo llamar al código de ensamblado en el programa: | |
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | asm | |
| 7 | + | // Aquí va el código Assembler | |
| 8 | + | end; | |
| 9 | + | ``` | |
| 10 | + | ||
| 11 | + | Ejemplo de uso del ensamblador en línea: | |
| 12 | + | ||
| 13 | + | ``` pascal | |
| 14 | + | var | |
| 15 | + | intWert: Integer; | |
| 16 | + | intErgebnis : Integer; | |
| 17 | + | ||
| 18 | + | begin | |
| 19 | + | intWert := ...; | |
| 20 | + | // es requerido por Lazarus/Free Pascal en los procesadores Intel x86: | |
| 21 | + | {$ASMMODE intel} | |
| 22 | + | asm | |
| 23 | + | MOV EAX, intWert // IntWert//asigna el valor de la variable IntWert al registro EAX | |
| 24 | + | ADD EAX, 110B // agregar el valor binario 110 (el decimal correspondiente es 6) | |
| 25 | + | SUB EAX, 2 // resta el valor decimal 2 | |
| 26 | + | MOV intErgebnis, EAX // asigna el contenido del registro EAX a la variable intErgebnis | |
| 27 | + | end; | |
| 28 | + | ... := IntToStr(intErgebnis); | |
| 29 | + | end; | |
| 30 | + | ``` | |
| 31 | + | ||
| 32 | + | --- | |
| 33 | + | *From the Free Pascal wiki, page "Asm/es", as it stood on 2020-01-31 after a change by GAN, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
