Re: NASM 0.98.39 vs. NASM 2.03.01 disassembly



Frank Kotler <fbkotler@xxxxxxxxxxx> wrote:
global _start

section .text

_start:
nop
mov ebx, -1
mov bx, ds
lsl eax, bx
lsl eax, ebx

lsl eax, [last_word]
mov eax, [last_word] ; segfault! (but not with ax)

mov eax, 1
int 80h

align 16
code_size equ $ - $$

section .data
times 4096 - code_size + 20h - 2 db 0
last_word dw 2Bh

I've tried this, but I can't figure out how you are supposed to link
this sucker. All I get is segmentation fault or silent failure to run
it at all.

BTW, my nasm (a old one, I think) refuses to assemble "lsl eax, ebx".


Please tell me how, for Linux ELF and DJGPP.


--
MartinS
.



Relevant Pages

  • Re: NASM 0.98.39 vs. NASM 2.03.01 disassembly
    ... Is this a trick question? ... lsl eax, ebx ... You can say it's "reading" all of ebx, and discarding the high 16 bits if you want. ... register, the register size is either 32-bits or 8-bits. ...
    (alt.lang.asm)
  • Re: NASM 0.98.39 vs. NASM 2.03.01 disassembly
    ... mov ebx, -1 ... lsl eax, ebx ... "int 80h" won't work in DJGPP, of course, but you could still step through it with a debugger (maybe... ...
    (alt.lang.asm)
  • Re: NASM 0.98.39 vs. NASM 2.03.01 disassembly
    ... Intended to be stepped through in a debugger, rather than "run", ... mov ebx, -1 ... lsl eax, ebx; ... usage. ...
    (alt.lang.asm)
  • Re: DivMod
    ... mov ebx, edx ... mov, edx ... // Require: Hi < D function UI32x2DivMod32: UInt64; assembler; register; nostackframe; asm div ecx ...
    (borland.public.delphi.language.basm)
  • Re: DivMod
    ... > var Remainder: Integer); ... mov ebx, edx ... mov, edx ...
    (borland.public.delphi.language.basm)