Recent Posts

Pages: 1 ... 8 9 [10]
91
Example Code / Re: My own 64-bit `puts' instruction (No length required)
« Last post by fredericopissarra on October 05, 2023, 03:42:59 PM »
Maybe I'm not understanding how scas works, but isn't the result of scasb stored in rbx in 64-bit assembly?
Nope! scasb tests AL against ES:[RDI], setting the flags. repnz scasb does the same, RCX times while ZF=0.

Quote from: MediocreVeg1
Wouldn't the assembler get confused if I used 64-bit syscalls on 32-bit registers? Or if I put some arguments of a syscall in R?? registers and others in E?? registers?
Nope! E?? registers are the lower 32 bits of R?? registers. When you use a R?? register the instrunction is prefixed with a REX prefix (and, an immediate can be bigger), like, for example:

Code: [Select]
  mov eax,-1    ; B8 FF FF FF FF
  mov rax,-1    ; 48 B8 FF FF FF FF FF FF FF FF

When using EAX the upper 32 bits are automagically (hehe) zeroed.

Quote from: MediocreVeg1
Yeah, I put it into my procedure as well after you showed your example. Wouldn't this event be highly unlikely though? I think 2^32-1 is like 4294967295 bytes so every single byte after the starting address of the string would have to be non-zero, right?
That's why it doesn't make sense using R?? registers to hold string lengths...

[]s
Fred
92
Example Code / Re: My own 64-bit `puts' instruction (No length required)
« Last post by alCoPaUL on October 03, 2023, 05:08:47 PM »
you can just iterate displaying letters until it's \0..

so you can display a 1 gigabyte or more worth of strings and then cut it when it's \0.
93
Programming with NASM / Re: blsi
« Last post by Frank Kotler on September 26, 2023, 10:57:25 PM »
Right!
I wonder how suncowiam is making out with it?

Best,
Frank

94
Programming with NASM / Re: blsi
« Last post by fredericopissarra on September 26, 2023, 07:02:28 PM »
I believe BLSI instruction was introduced in Haswell microarchitecture. It is from BMI1 instruction set (VEX prefix) - so it is listed in Intel SDM. Of course old NASM versions don't have support for it.
95
Programming with NASM / Re: blsi
« Last post by Frank Kotler on September 23, 2023, 04:18:53 AM »
I dunno. I had a pretty good grasp of 8086/8088 code at one time. Newer code not so much. IIdid  didn't know blsi, but rather than post, "I dunno' I decided to fool with it and came up with that. 64 bit regs apparently DON'T work.

I dunno,
Frank


96
Programming with NASM / Re: blsi
« Last post by debs3759 on September 23, 2023, 01:53:08 AM »
Code: [Select]
bits 64
blsi eax, ebx
...seems to work...
?
Hi Debs...?

Best,
Frank

Ah, the linked version of the manual is version 2.10.04, so maybe the instructions were added since then. I haven't looked at programming manuals for quite some time, and most code I've written will run of a 386 or 486. I really need to do some more coding, and learn how to use more than basic x86 instructions :)
97
Programming with NASM / Re: blsi
« Last post by Frank Kotler on September 22, 2023, 11:10:02 PM »
I should mention version!
2.14.02

Best,
Frank

98
Programming with NASM / Re: blsi
« Last post by Frank Kotler on September 22, 2023, 10:56:54 PM »
Code: [Select]
bits 64
blsi eax, ebx
...seems to work...
?
Hi Debs...?

Best,
Frank

99
Programming with NASM / Re: blsi
« Last post by debs3759 on September 22, 2023, 10:54:00 PM »
Hi,

I see BLSI listed in the following document:
https://redirect.cs.umbc.edu/~chang/cs313.s13/nasmdoc/nasmdoc.pdf

However, when I try to compile an asm file with blsi op, I get the following:
blsi.asm:15: error: parser: instruction expected

The line:
    blsi rax, rbx

Am I missing something or nasm doesn't support this instruction?

Thanks

It's listed as a future opcode, so isn't supported yet. I don't know which processor family supports (or will support) it, so you may need to wait a while for someone to add the BM11 and BM12 instruction sets.
100
Programming with NASM / blsi
« Last post by suncowiam on September 22, 2023, 09:52:01 PM »
Hi,

I see BLSI listed in the following document:
https://redirect.cs.umbc.edu/~chang/cs313.s13/nasmdoc/nasmdoc.pdf

However, when I try to compile an asm file with blsi op, I get the following:
blsi.asm:15: error: parser: instruction expected

The line:
    blsi rax, rbx

Am I missing something or nasm doesn't support this instruction?

Thanks
Pages: 1 ... 8 9 [10]