fork download
  1.  
  2. %macro print 2
  3. mov rax,1
  4. mov rdi,1
  5. mov rsi,%1
  6. mov rdx,%2
  7. syscall
  8. %endmacro
  9.  
  10. %macro read 2
  11. mov rax,0
  12. mov rdi,0
  13. mov rsi,%1
  14. mov rdx,%2
  15. syscall
  16. %endmacro
  17.  
  18.  
  19. section .data
  20. msg1 db " operation to performed "
  21. msglen1 equ $-msg1
  22.  
  23. msg2 db " MENU "
  24. db "1.bcd to hex",0ah
  25. db "2. hex to bcd",0ah
  26. db "3.exit ",0ah
  27. db "enter the choice "
  28.  
  29. msglen2 equ $-msg2
  30.  
  31. section .bss
  32. choice resb 2
  33.  
  34. section .text
  35. global _start:
  36. _start:
  37.  
  38. print msg1,msglen1
  39. print msg2,msglen2
  40. read choice,2
  41.  
  42.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.s: Assembler messages:
prog.s:2: Error: junk at end of line, first unrecognized character is `%'
prog.s:3: Error: too many memory references for `mov'
prog.s:4: Error: too many memory references for `mov'
prog.s:5: Error: bad register name `%1'
prog.s:6: Error: bad register name `%2'
prog.s:8: Error: junk at end of line, first unrecognized character is `%'
prog.s:10: Error: junk at end of line, first unrecognized character is `%'
prog.s:11: Error: too many memory references for `mov'
prog.s:12: Error: too many memory references for `mov'
prog.s:13: Error: bad register name `%1'
prog.s:14: Error: bad register name `%2'
prog.s:16: Error: junk at end of line, first unrecognized character is `%'
prog.s:19: Error: no such instruction: `section .data'
prog.s:20: Error: no such instruction: `msg1 db " operation to performed "'
prog.s:21: Error: no such instruction: `msglen1 equ $-msg1'
prog.s:23: Error: no such instruction: `msg2 db "  MENU "'
prog.s:24: Error: no such instruction: `db "1.bcd to hex",0ah'
prog.s:25: Error: no such instruction: `db "2. hex to bcd",0ah'
prog.s:26: Error: no such instruction: `db "3.exit ",0ah'
prog.s:27: Error: no such instruction: `db "enter the choice  "'
prog.s:29: Error: no such instruction: `msglen2 equ $-msg2'
prog.s:31: Error: no such instruction: `section .bss'
prog.s:32: Error: no such instruction: `choice resb 2'
prog.s:34: Error: no such instruction: `section .text'
prog.s:35: Error: no such instruction: `global _start:'
prog.s:38: Error: no such instruction: `print msg1,msglen1'
prog.s:39: Error: no such instruction: `print msg2,msglen2'
prog.s:40: Error: no such instruction: `read choice,2'
stdout
Standard output is empty