Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scanf(„%s” , buffer)
- .data
- name: .ascii "What is your name?n"
- name2: .ascii "Your name is:"
- formatScanf: .ascii "%s"
- .bss
- buffer: .size 100 #100 bytes for string input
- .text
- .globl main
- main:
- #Printing question #works fine
- pushl $name
- call printf
- #Get answers
- push $buffer #2nd argument for scanf
- push $formatScanf #1st argument of scanf
- call scanf
- #Exiting
- pushl $0
- call exit
- lab3.s: Assembler messages:
- lab3.s:8: Error: expected comma after name `' in .size directive
- #printf proba
- .data
- name2: .string "Your name is: %s "
- formatScanf: .string "%s"
- name: .string "What is your name?n"
- .bss
- buffer: .space 100
- .text
- .globl main
- main:
- #Printing question #works fine
- pushl $name
- call printf
- #Get answers
- push $buffer #2nd argument for scanf
- push $formatScanf #1st argument of scanf
- call scanf
- push $buffer
- push $name2
- call printf
- #Exiting
- pushl $0
- call exit
- buffer: .space 100
- .size buffer, 100
Add Comment
Please, Sign In to add comment