Moderatore: Staff



414N ha scritto:Ci sono anche NASM e YASM, con una sintassi simile a quella Intel.
.MODEL small
.STACK
.DATA
VAR DW ?
.CODE
.STARTUP
MOV VAR, 0
.EXIT
END

jimmy_page_89 ha scritto:414N ha scritto:Ci sono anche NASM e YASM, con una sintassi simile a quella Intel.
ho provato a dare in pasto a nasm questo
- Codice: Seleziona tutto
.MODEL small
.STACK
.DATA
VAR DW ?
.CODE
.STARTUP
MOV VAR, 0
.EXIT
END
ma non ne vuole sapere di compilare


jimmy_page_89 ha scritto:ho provato a dare in pasto a nasm questo
- Codice: Seleziona tutto
.MODEL small
.STACK
.DATA
VAR DW ?
.CODE
.STARTUP
MOV VAR, 0
.EXIT
END
ma non ne vuole sapere di compilare
section .text
global _start ; dichiara l'entry point
_start: ; entry point
mov var, 0
mov eax,1 ; system call (sys_exit)
int 0x80 ; chiama il kernel per l'uscita
section .data
var resw 1 ; riserva 1 WORD a var

phobos3576 ha scritto:Prova:
- Codice: Seleziona tutto
section .text
global _start ; dichiara l'entry point
_start: ; entry point
mov var, 0
mov eax,1 ; system call (sys_exit)
int 0x80 ; chiama il kernel per l'uscita
section .data
var resw 1 ; riserva 1 WORD a var
6: error: invalid combination of opcode and operands
13: warning: uninitialized spacedeclared in non-BSS section `.data': zeroing
jimmy_page_89 ha scritto:
- Codice: Seleziona tutto
6: error: invalid combination of opcode and operands
13: warning: uninitialized spacedeclared in non-BSS section `.data': zeroing
mov word [var], 0


jimmy_page_89 ha scritto:Esiste un modo per compilare assembly 8086 su linux con sintassi intel?

zoros ha scritto:non capisco perché usi "var" ... per allocare uno spazio ram basta un db, dw, ecc. ...
zoros ha scritto:se invece vuoi usare l'originale MASM c'è sempre dosbox ...

phobos3576 ha scritto:zoros ha scritto:non capisco perché usi "var" ... per allocare uno spazio ram basta un db, dw, ecc. ...
In questo caso var è un nome di variabile e non una keyword.
var dw 0 ; riserva 1 WORD a var
...
zoros ha scritto:sì, ho letto frettolosamente il codice ... mi suonava male il "resw" ... io avrei scritto:var dw 0 ; riserva 1 WORD a var
chiaro che var è un identificatore ... brutta scelta direi...

Visitano il forum: Nessuno e 2 ospiti