Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;this is completely by me
- ;if you want to know more, visit
- ;http://www.oocities.org/codeteacher/x86asm/asml1002.html
- ;and
- ;http://www.tutorialspoint.com/assembly_programming/assembly_arithmetic_instructions.htm
- section .data ;initialized variables
- letraA db 'A',0xa ;our letter and \n
- lenletraA equ $-letraA ;length in bits
- segment .bss ;uninitialized variables
- letra resw 1 ;reserve memory space for one letter
- section .text
- global _start
- _start:
- mov ax, [letraA] ;mov the letter A to ax
- mov [letra], ax ;mov ax to new variable
- ;we also can use eax, but i use ax because it
- ;use just 16bits and eax use 32
- ;to print without \n you also can use al (8bits)
- mov eax, 4 ;sys_write
- mov ebx, 1 ;stdout
- mov ecx, letra ;our variable to output
- mov edx, lenletraA ;length of output
- int 0x80 ;call hernel to print
- mov eax, 1 ;sys_exit
- mov ebx, 0 ;tell the system it's everything ok
- int 0x80 ;call kernel to finisih program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement