readstr is not part of the source code you linked? where do you get this subroutine from?
It's in the updated version of stressful's code (
same thread):
prnchr
prnchrs
prnchar
prnstr
prnstrz
prnstrd
readch
readchr
readstr
delay
mem_alloc
mem_free
file_new
file_open
file_read
file_write
file_close
file_size
exit
exitp
newline
halt
prnstreg
prnreg
prnregd
prnregdu
dumpreg
dumpregd
dumpregdu
dumpseg
dumpenv
flags
stackview
memview
memviewc
mem_reset
mem_set
mem_copy
mem_load
opsize
opcode
prnint
prnintu
prnhex
prnhexu
prnoct
prnoctu
prnbin
prnbinu
prnbinf
prnbinb
fpbin
fpbind
prndbl
prndble
prndblr
prnflt
prnfltr
prndblx
dblsplit
fpdinfo
fpfinfo
dec2str
dec2stru
hex2str
hex2stru
dbl2str
readint
readflt
readdbl
fpu_stack
fpu_sflag
fpu_cflag
fpu_tag
fpu_reg
fpu_copy
fpu_precision
fpu_round
sse_round
sse_flags
prnxmm
dumpxmm
clearxmm
prnymm
dumpymm
clearymm
prnintd
prnintw
prnintb
str2int
str2dbl
str2flt
dbl2int
int2dbl
rndigit
rndint
isint
digiti
digith
factorial
powint
pow2
iseven
isodd
bconv
bitfield
addf
subf
mulf
divf
pow
sqroot
log10
ln10
deg2rad
rad2deg
sine
tangent
cosine
sincos
atangent
chr_isdigit
chr_isalpha
chr_isupper
chr_islower
chr_toupper
chr_tolower
chr_chcase
chr_find
chr_count
chr_shuffle
ascii
str_copy
str_length
str_cmpz
str_cmp
str_toupper
str_tolower
str_reverse
str_trim
str_wordcnt
str_token
str_find
str_findz
str_appendz
str_append
sort_byte
sort_int
sort_dbl
sort_dblx
sort_flt
aprndbl
aprndblx
aprnflt
aprnint
So I have been trying to learn the basics of nasm programing. I started by using http://forum.nasm.us/index.php?topic=2062.0 as a base. I am trying to capture text from the user and put it into memory. I just can't seem to figure out how to mov it.
I'm not really familiar with his codebase, but a quick look at his source for nsm64.asm gives a good hint as to what your problem is.
;-------------------------------
;readstr(1)/1
;Get string from keyboard
;and 0-ended it
;-------------------------------
;RAX : Address of the buffer
;-------------------------------
;Ret : # of bytes entered in RAX
; : String in buffer
;Note : Use with prnstrz
; : Buffer is of type DB/RB
; : Buffer must be large enough
; : Ret -1 signals error
;-------------------------------
So what this function does is takes as an argument (in RAX) the address of your memory location, the memory location gets updated with the string that was entered by the user, and then RAX is updated with the number of bytes read from the user. So in your code, it should look something like this:
...
mov rax, prompt1
call prnstrz
mov rax, name
call readstr
call newline
mov rax, name
call prnstrz
...
Regards,
Bryant Keller