assembly

function's return address is different from its supposed value, buffer overflow, HELP PLEASE

Good day everyone! I’m trying to understand how buffer overflow works. I’m doing this for my project in a computer security course I’m taking. Right now, I’m in the process of determining the address of the function’s return address which I’m supposed to change to perform a buffer overflow attack. I’ve written a simple program based from...

PIC Assembly function calling

I'm writing a pretty basic program in PIC18 assembly. It requires that I write a subroutine to multiply two 16-bit numbers... This is what I have right now: ;*********************************************************************** ; mul_16bit: subroutine that multiplies two 16 bit numbers stored in ; addresses mul_16ptr1, mul_16ptr1+1...

How to write a X86_64 _assembler_ ?

Goal: I want to write an X86_64 assembler. Note: marked as community wiki Background: I'm familiar with C. I've written MIPS assembly before. I've written some x86 assembly. However, I want to write an x86_64 assembler -- it should output machine code that I can jump to and start executing (like in a JIT). Question is: what is the best...

Call Another Source File

I'm building a program(in 16-Bits) using Assembly(nasm as the assembler), but as I love to have things organized in different source files. Let's think I have 2 sources, one called main.asm and another one called source2.asm, but I want to call the source1.asm content in the middle of main.asm. How could I do this? ...

How to compile code generated by a Java or C++ App

I've been learning compiler theory and assembly and have managed to create a compiler that generates x86 assembly code. How can I take this assembly code and turn it into a .exe? Is there some magical API or tool I have to interact with? Or is it simpler than I think? I'm not really sure what's in a .exe, or how much abstraction lies b...

Problem with understanding arm assembly code structure

code is listed as follows, I want to know in the ending part 0000e0b4 001d22d0 ldrsbeq r2, [sp], -r0 does this do calculation for this line of code since it loads the address defined in the ending part 0000e03c e59f4070 ldr r4, [pc, #112] ; 0xe0b4 and why are code organized in this way? -[Cube message1]: 0000e02c ...

How can I write software that runs very close to system start?

I'm interested in writing software that runs with as little booting as possible. What do I do? Is this an assembly question? Do I have to do something special with the disk the software is to run from? To clarify, I'm looking for a point at which stdin and stdout are available, but not much else. ...

How to work with Strings in ARM?

This is a homework question. Frankly, I'm not sure how a C program delivers a string parameter to the assembly level. I have the function StringSearchInString( text, searchString); and the parameters text = "Hallo Alles klar" searchString = "ll" I know ARM delivers the parameters into register R0, R1 respectively for text, searchSt...

How to load kernel into memory, from an ISO.

Hello fellow nerds! At compile-time I link my Assembly bootstrap together with my kernel, into an *.img file, which I then convert into an *.iso image using MagicISO. I then boot from this *.iso image. But the problem is that I want to read the second sector of the file (the kernel) into memory at 0x1000. But I only know how to do so, wi...

8085 arithmetic program

Can I get the assembly language arithmetic program operations for 8 bit microprocessor programming ? ...

printer in pdp-11

I have this snippet of the code. can somebody explain why It doesn't work, I want every 5 seconds print "Syntax Error" thanks in advance tks = 177560 tkb = 177562 tps = 177564 tpb = 177566 lcs = 177546 . = torg + 2000 main: mov #main, sp mov #outp, @#64 mov #200, @#66 mov #clock, @#100 mov #300, @#102 mov #101,...

How many times should a loop be unwinded?

I'm learning about loop unrolling to avoid stalls caused by dependencies. I found many examples on internet and in literature, but I found no explanation on how the algorithm used to obtain the optimized code works (in case there is one such algorithm, of course). In particular, I don't know how to determinate how many times should the l...

Isn't PTR redundant in this instruction : CALL DWORD PTR [XXXXXXXX]

Isn't PTR redundant in this instruction CALL DWORD PTR [XXXXXXXX]. If the instruction was CALL DWORD [XXXXXXXX] This also says, Call the DWORD length value located at the address XXXXXXXX. Why PTR then? ...

What happens from the moment we press a key on the keyboard, until it appears in your word document

This question was in my job interview.. I just to see whether I gave all the details... ...

Compiling Assembly code

Hello, I'm trying to compile an ASM program I wrote with NASM and the "ld" command from DJGPP. This is the code for the batch file I'm using to compiling it: @echo off set path=C:\NASM;%PATH% nasm -f aout -o start.o start.asm ld -T link.ld -o kernel.bin start.o But when I run the file I get: start.o: file not recognised: File format...

obfuscated C/asm "Hello, world!" program, I don't understand.

why does the following code print "Hello, world!" (on "my" system)? .file "test.c" .globl main .data .align 32 .type main, @object .size main, 56 main: .value 3816 .value 0 .value 18432 .value 27749 .value 28524 .value 8236 .value...

clock on pdp-11

hello, I'm a little bit confused about simple program which I wrote, can You please explain why it quits after printing only one character, I expected it will print me character every 5 seconds, thanks in advance tks = 177560 tkb = 177562 tps = 177564 tpb = 177566 lcs = 177546 . = torg + 2000 main: mov #main, sp mov #clock, ...

How can I create a parallel stack and run a coroutine on it?

Hey guys, In today's "Zneak's time-wasting adventures", I decided I should try to implement coroutines (I think that's how I should call them). I expect to have to use assembler, and probably some C if I want to make this actually useful for anything. Bear in mind that this is for educational purposes. Using an already built coroutine ...

ARM - Infinite Loop While Searching String

Can anybody point out why? I can't see the problem. String to search: "aassaas" String to search with: "as" SEARCHSTRING: STMFD SP!, {R4-R7, LR} MOV R6, #0 @Matches found MOV R3, #0 @Placeholder LOOP: LDRB R4, [R0] @R4 = String to search LDRB R5, [R1] @R5 = String to sear...

from ASCII to usual numbers

hello, I have some question about assembly, is it possible to convert ASCII code of numbers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) without 10 compares and branches like if(input == 48) return 0; ... (I'm talkin about code on assembly!) thanks in advance ...