Skip to content
Advertisement

Tag: assembly

nasm assembly linux timer or sleep

I’m trying to find a way to make my code wait for two seconds before proceeding. I’m using nasm for Linux in protected mode, so I can only use int 80h. I found a syscall called “alarm” (27) and another called “pause” (29). However, when I try to use those, the program waits and finishes instead of continuing execution. I’ve

How to clear screen on protected mode

I’m using NASM for Linux and I’d like know how, in the protected mode, you can clear the screen. I found a solution using the int10h, but on the protected mode I can only use int80h. Thanks in advance. Answer You can write x1b[2J to the standard output so the terminal get cleared and fix the cursor position using x1b[H,

How to print a number in ARM assembly?

I am trying to print a number that I have stored. I’m not sure if I am close or way off. Any help would be appreciated though. Here is my code: It compiles and runs, but I don’t see anything printed. From what I understand, I need the address of where to start printing in r1, how many bytes in

How do I get the interrupt vector number on Linux?

When I run “cat /proc/interrupts”, I can get the following: How can I get the interrupt number of “NMI” “LOC” “SPU” “PMI”, etc. Answer On x86 NMIs are always on interrupt vector 2. The number is hard-coded just as common exceptions (division by 0, page fault, etc). You can find this in the CPU documentation from Intel/AMD. If the APIC

What’s the purpose of the UD2 opcode in the Linux kernel?

I have found the following fragment in the Linux kernel (not the corresponding C code though), somewhere during the start up phase. You can clearly see the 0F 0B parts, which stand for the UD2 opcode (IDA refused to disassemble). There are some possible usages for this opcode explained here and here. In this case, however, the opcodes after this

Advertisement