Author Topic: error: Possible causes: recursive EQUs, macro abuse  (Read 4243 times)

Offline Direser

  • New Member
  • Posts: 1
error: Possible causes: recursive EQUs, macro abuse
« on: September 13, 2019, 10:04:15 PM »
Please help me!!
i have been finding it difficult to run this code in sequence but it usually stopes at displaying my name.

Code: [Select]
global _start

_start:

  mov  eax,4              ;sys_write
  mov  ebx,1              ;To stdout
  mov  ecx,urname       ;'Input some data: '
  mov  edx,urname_size
  int  80h                        ;Call kernel

  mov  eax,3                 ;sys_read. Read what user inputs
  mov  ebx,0                 ;From stdin
  mov  ecx,inp_buf                 ;Save user input to buffer.
  int    80h

  push eax

  mov  eax,4
  mov  ebx,1
  mov  ecx,Yname         ;'You entered: '
  mov  edx,Yname_size
  int    80h

  mov  eax,4
  mov  ebx,1
  mov  ecx,inp_buf
  pop  edx
  int  80h

  mov  eax,1
  mov  ebx,0
  int  80h

;next line

mov  eax,4          ;sys_wite
  mov  ebx,1           ;To stdout
  mov  ecx,old           ;'Input some data: '
  mov  edx,old_size
  int  80h                    ;Call kernel

  mov  eax,3            ;sys_read. Read what user inputs
  mov  ebx,0             ;From stdin
  mov  ecx,inp_buf               ;Save user input to buffer.
  int    80h

  push eax

  mov  eax,4
  mov  ebx,1
  mov  ecx,age                ;'You entered: '
  mov  edx,age_size
  int    80h

  mov  eax,4
  mov  ebx,1
  mov  ecx,inp_buf
  pop  edx
  int  80h

  mov  eax,1
  mov  ebx,0
  int  80h

section .bss

inp_buf resb 1000

section .data

urname: db 'What is your name: '
urname_size: equ $-urname

Yname: db 'Your name is: '
Yname_size: equ $-Yname

old: db 'How old are you: '
old_size: equ $-old

age: db 'Your age is: '
age_size: equ $-age

« Last Edit: September 13, 2019, 10:28:15 PM by Frank Kotler »

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2565
  • Country: us
Re: error: Possible causes: recursive EQUs, macro abuse
« Reply #1 on: September 13, 2019, 10:44:53 PM »
Hi direser.

Welcome to the forum.

You exit the program right after printing your name! Commenting out that section makes it work perfectly for me. Nice job!

Best,
Frank


 

SMF spam blocked by CleanTalk