How to define data or buffers?
Ismael-VC opened this issue · 1 comments
Ismael-VC commented
I am trying to do a simple hello world, I am learning using nasm, perhaps the syntax style is not the same?
section .data
syscall: equ 0x80
syswrite: equ 4
stdout: equ 1
sysexit: equ 1
success: equ 0
str: db `Hello World!!!\n`
len: equ $-str
section .text
global _start
_start:
; hello
mov rax, syswrite
mov rbx, stdout
mov rcx, str
mov rdx, len
int syscall
; exit
mov eax, sysexit
mov ebx, success
int syscall
I haven't found examples or tests that do this, is it possible with the replL
(rip 0x00007ff23f7d4001)> msg: db "hello"
Invalid intruction
(rip 0x00007ff23f7d4001)> .section data
Invalid intruction
Best regards.
foxypiratecove37350 commented
This REPL only allow us to put code in the .text
section, and it uses a in-REPL parser, so not every things of a full assembler are accessible, like data writing directives or certain instructions. Also, your NASM code is for 32-bits x86 while this REPL is for 64-bits x86 (x86_64
).
Sincerely,