Recent Posts

Pages: [1] 2 3 ... 10
1
Other Discussion / Re: Just picked up a Linux assembly book.
« Last post by Frank Kotler on March 19, 2023, 11:55:48 PM »
Hi tysonprpgrammer.

I have corresponded with Jeff Duntemann a little bit about Linux programming and Nasm... can't think of anything he would thank me for... He seems like a really nice guy. I'm sure you will enjoy his book!

You  probably know that the first edition of "Step by Step" used Masm but he switched to Nasm (and Linux) after that.

Best,
Frank

2
Other Discussion / Just picked up a Linux assembly book.
« Last post by tysonprogrammer on March 19, 2023, 11:20:07 PM »
I just picked up a copy of Assembly Language Step by Step Programming with Linux by Jeff Duntemann and it thanks Frank Kotler, this the the same Frank Kotler that works on nasm?
3
Using NASM / Simple tasks states for virtual 8086 mode
« Last post by Deskman243 on March 18, 2023, 04:04:30 AM »
Goodness and best wishes chat

I'm continuing the subjects from earlier posts referenced here https://forum.nasm.us/index.php?topic=3712.0
I've cleaned around my custom task and now have code for setting up the task state segment. I'm trying to test a simple IOPB from another forum by running a basic call for alphanumeric text here

Code: [Select]
mov ecx,0

mov cx,40h
mov es,cx
mov dx,0
mov dx,es:[63h]
add dl,4            ;debugging area
mov al,es:[65h]
and al,11011111b
out dx,al
mov es:[65h],al

ret


By the looks of things testing this does not get any more easy however debugging these object files gets lost around the mentioned area. I'm hoping that I'm not the only one going through this and would really like to continue looking into this here again and my code is available on here to anyone else who would like to look too.

Cheers
4
Nasm doc 5.3:
Code: [Select]
%if __?BITS?__ == 16
...
%elif __?BITS?__ == 32
...
%elif __?BITS?__ == 64
...
%endif
5
Using NASM / Re: How do you make an NASM macro use different code for 16/32 bits?
« Last post by debs3759 on March 13, 2023, 01:37:32 AM »
I just looked it up in the manual (section 4.4.1, you will find it helpful to read the manual), and I should have said #ifdef. The code would be

Code: [Select]
#ifdef Is16Bits
;16bit code goes here
#else
;32bit code goes here
#endif

6
Using NASM / Re: How do you make an NASM macro use different code for 16/32 bits?
« Last post by ben321 on March 12, 2023, 11:13:33 PM »
That's where I'd use things like #ifdefine and it's companions. Nasm doesn't write your code for you.

Isn't ifdefine a C instruction though? I didn't know NASM could do that. I had hoped it would. So I'd use it like this then.

#ifdefine Is16Bits
;16bit code goes here
#else
;32bit code goes here
#endif


How do I do the "Is16Bits" part though? Does NASM provide a compiler-set constant that is either defined or not defined, based on what bitness mode is currently being used?
7
Using NASM / Re: How do you make an NASM macro use different code for 16/32 bits?
« Last post by debs3759 on March 12, 2023, 03:42:01 PM »
That's where I'd use things like #ifdefine and it's companions. Nasm doesn't write your code for you.
8
Using NASM / Code practice for task state segments and virtual mode (VMM)
« Last post by Deskman243 on March 12, 2023, 12:13:27 PM »
Greetings again chat

This post is a continuation from my previous look into virtual 8086. Here is the closest try that I have made to getting the tss model designs for a v86 application. I managed to get the reference on the new tss of the gdt but I simply have no clue how to test the new structures in or around the virtual mode calls. Perhaps anyone else here may have more knowledge about this than I do.
Besides this I have to try and adjust my custom virtual mode print test because the ret had given a placement error however I'm really convinced that these are the right steps so I'll bereally happy to continue this conversation and am available to check or respond here in time.

Good show guys and cheers!
9
Using NASM / How do you make an NASM macro use different code for 16/32 bits?
« Last post by ben321 on March 12, 2023, 06:16:07 AM »
Lets say a macro included something like this:
MOV EAX,[ptrData]

That's for 32 bit code. Let's say I wanted the macro to be usable in both 32 bit and 16 bit code though, so I didn't need to write 2 separate macros. Is there like predefined constant that NASM can set, that will let you tell your macro to behave differently? For the above example, I'd want the 16 bit code to say:
MOV AX,[ptrData]
10
Using NASM / NASM is missing a more modern x86 instruction!
« Last post by ben321 on March 12, 2023, 03:56:01 AM »
NASM is not recognizing the instruction LOADIWKEY. While this can only be run at ring0 according to the documentation, it does exist, and therefore shouldn't be left out of the capabilities of NASM. It's the instruction to load the IWkey (Internal Wraping key, basically the master key) for the Key Locker system. Key Locker is Intel's secure on-chip facility for handling AES encryption and decryption (yes, you can actually do AES in hardware now, instead of coding the whole AES algorithm in software). When you load a key to encrypt or decrypt content, the CPU first encrypts the AES key with the IWkey. Then when you want to use the AES key to perform encryption or decryption, the CPU first decrypts the key internally (the unencrypted AES key, after initial creation, is never exposed to the rest of the system). After the key has been decrypted entirely within the CPU, it's then used to encrypt or decrypt the content in question. In this way, you can think of the IWkey as the master password in password management software. You can't get any of the passwords from the software, until you enter a master password to decrypt the stored passwords.

The IWkey is also not exposed to the rest of the system (again except during initial creation, unless you turn on a higher security level so it internally generates a random IWkey).

The official specifications for the Intel Key Locker can be found at:
https://www.intel.com/content/www/us/en/develop/download/intel-key-locker-specification.html

The section in this PDF document that deals with the instruction in question is section 3.12.
Pages: [1] 2 3 ... 10