nasm

Mixing 32 bit and 16 bit code with nasm

Hi, This is a low-level systems question. I need to mix 32 bit and 16 bit code because I'm trying to return to real-mode from protected mode. As a bit of background information, my code is doing this just after GRUB boots so I don't have any pesky operating system to tell me what I can and can't do. Anyway, I use [BITS 32] and [BITS 1...

Unable to run assembly program

Hi, I have just started reading Introduction to 80x86 Assembly Language and Computer Architecture.I am trying to use NASM, to run the first example shown in chapter 3 ,but unsuccessfully.Has anyone read the book,and run the examples? ...

Why does this NASM code print my environment variables?

I'm just finishing up a computer architecture course this semester where, among other things, we've been dabbling in MIPS assembly and running it in the MARS simulator. Today, out of curiosity, I started messing around with NASM on my Ubuntu box, and have basically just been piecing things together from tutorials and getting a feel for h...

Learning x64 on a linux system

I am looking for some good resources on x64 assembly on a linux system, in order to write code myself. I am also looking for some introductory notions like memory spaces (stack, heap, etc.). I found a good free book online, Programming From the Ground UP, the trouble is, it is targeted at x32 linux systems. I also played a lot with gcc -...

What is the best resource for learning (N)ASM?

I've been wanting to learn assembly for a while now, and although I've tried a few times before, I haven't really been able to get past "Hello, world". Are there any good introductory tutorials to assembly (preferably using NASM, as I use Windows and Linux)? I do have a bit of C knowledge, but mainly code in higher-level languages such a...

dollar-terminated strings

In my assembly language class, our first assignment was to write a program to print out a simple dollar-terminated string in DOS. It looked something like this: BITS 32 global _main section .data msg db "Hello, world!", 13, 10, ’$’ section .text _main: mov ah, 9 mov edx, msg int 21h ret As I understand it, the $ sign serves...

A Simple Assembly Input Question

This is my first post on this site. I am taking an X86 assembly class and I am having a bit of trouble with my second project. The project is very simple. The program needs to take in a simple string from the user and display it back. I have gotten the program to take input from the user but I can't seem to store it. Here is what I have ...

Which x86 assembler do you use?

For anyone who works with x86 assembly, I'm curious which assembler you use. Preferably, the name should be an acronym and end in "ASM" =) ...

How do I compile DOS programs on Debian?

For my assembly language class, we're writing DOS programs using DPMI. Unfortunately, I don't have access to a 32-bit windows machine all the time. I do have a Debian virtual machine installed on just about every computer I do use. I've got both DOSBox and DOSEMU installed. Is there any way that I can assemble and compile the program...

How to translate NASM "push byte" to GAS syntax?

Why I'm "porting" a NASM source to GAS and I found the following lines of code: push byte 0 push byte 37 GAS doesn't allow "push byte" or "pushb". How should I translate the above code to GAS syntax? Thanks ...

What are some good x86 assembly language resources?

What are some good online resources (references, books, tutorials, documentation, etc) for learning and programming in assembly language (more specifically nasm)? It seems as though some of assembly language is rather arcane and I sometimes have problems finding any good info on it. ...

Calling assembly routine in objective C

Hi I have written a function nabs in assembly file math.nasm as follows %ifdef USE_x86_ASM SECTION .text cglobal nABS ;*------------------------* ;* int nABS(int a) * ;* return value in eax * ;*------------------------* ALIGN 16 nABS: push ebx ...... ...... pop ebx ...

How do we shift from protected mode to real mode in Linux 2.6?

How do we shift from protected mode to real mode in Linux 2.6? ...

Basic yet thorough assembly tutorial (linux)?

I want to learn some practical assembly language having just learned the basic concepts in class. Are there any decent books or tutorials (nasm, etc) that would be recommended? ...

How to load kernel into memory from CD-ROM using Assembly (NASM)

Hello Everyone, I'm writing a bootstrap and kernel for myself and both bootstrap and kernel will be burn on a CD-R and will function as a CD-live. It is not a linux CD-Live or something else,is totally my own bootloader and kernel. I do not want to use other booloaders (i.e. GRUB) so please don't suggest me to use them. Here is my ques...

how to access sound card in linux using nasm

hello i want to know how i can access sound card from nasm assembly program using int 0x80. and also what values should i put in the registers when to access the sound card. is there any manual or something that has details about the arguments that we have to pass to the kernel to access the sound card or other hardware devices, please ...

Why does the mov instruction have to be used this way?

I've been looking around online a little bit at assembly tutorials and have been flipping through Art of Assembly as well. I keep getting hung up on one thing when changing segment registers though. I see code like: mov ax, cs mov ds, ax mov es, ax Why can't I just compress this to: mov ds, cs mov es, cs Is the first way faster s...

Windows API calls from assembly while minimizing program size

I'm trying to write a program in assembly and make the resulting executable as small as possible. Some of what I'm doing requires windows API calls to functions such as WriteProcessMemory. I've had some success with calling these functions, but after compiling and linking, my program comes out in the range of 14-15 KB. (From a source of ...

Disable L2/L1 caches

I am trying to disable the internal and external memory cache of my CPU, my configuration is above: -DELL Precision WorkStation -Intel Core 2 Duo E6550 2.33 GHz -Ubuntu 8.10 I've tried to disable it through BIOS, but it apears that DELL computers doesn't let users to access cache memory, I found then another way, it is to disable cache ...

Enable L1 cache as Ring 0

Hi everybody, I could finally disable the cache by running the code as Ring0, Thank you DrJokepu, the link you gave me was exactly what I needed.. but I have a new problem, cause when I insert the new module who disables the cache, that works grate, I just have to insmod my .ko file, so the init procedure where my code is written is cal...