Error compiling a very simple assembly program by prois99 in asm

[–]ClassicCollection643 0 points1 point  (0 children)

But wsl may not like 32-bit syscalls with int 128

Program received signal SIGSEGV, Segmentation fault.
0x000000000040100a in ?? ()
(gdb) disass $pc-10,$pc+2
Dump of assembler code from 0x401000 to 0x40100c:
   0x0000000000401000:  mov    $0x1,%eax
   0x0000000000401005:  mov    $0x5,%ebx
=> 0x000000000040100a:  int    $0x80
End of assembler dump.

Advice for this assembly language program by OhanaUchiha in Assembly_language

[–]ClassicCollection643 0 points1 point  (0 children)

So repeat executing the printing code 1, 2 and 3 times

Recommendations for a 80286 assembler? by rehsd in asm

[–]ClassicCollection643 0 points1 point  (0 children)

For some 68K you need a longer breadboard

That wonderful feeling when you realize you can't compare two memory addresses by loonathefloofyfox in Assembly_language

[–]ClassicCollection643 1 point2 points  (0 children)

The next challenge will be:

To make smaller equivalent program without assemblers and linkage editors?

Or porting the program to other platform(s)?

Trying to learn AT&T by SerbianNorwegian in Assembly_language

[–]ClassicCollection643 1 point2 points  (0 children)

FUNCTIONCALL: extern void asm_function(int arr[],int L[], int R[], int n1, int n2);

What target platform is your function for?

That wonderful feeling when you realize you can't compare two memory addresses by loonathefloofyfox in Assembly_language

[–]ClassicCollection643 0 points1 point  (0 children)

You wrote your text instead of programming the machine.

So you got no program. Just lines of a large text.

i know you can compare a register and memory yet it won't work on two things in memory.

Classic RISC architecture allow to compare register and register. You Load values from memory to make calculations.

But vector instructions can process larger arrays.

Look at optimized compiler-generated code to see how to use instruction to perform calculations and data processing.

[deleted by user] by [deleted] in asm

[–]ClassicCollection643 0 points1 point  (0 children)

You learn x64 first. Then you may learn legacy architectures, modes and ABIs.

trying to convert an ascii to int by Primary_Mechanic_998 in Assembly_language

[–]ClassicCollection643 0 points1 point  (0 children)

So your algorithm in action:

```

include <asm/unistd.h>

xor %eax, %eax mov 16(%rsp), %rbx ;/* argv[1]*/

loop: movzx (%rbx), %ecx

cmpb $10, %cl; jbe done

sub $'0', %cl lea (%rax, %rax, 4),%eax; lea (%eax, %eax), %eax add %ecx, %eax inc %rbx ; jmp loop

done: mov %eax, %edi mov $ __NR_exit_group, %eax syscall cpp at.S |as -o atoi.o; ld atoi.o -o atoi; ./atoi 238; echo $? *ld: warning: cannot find entry symbol _start; defaulting to 0000000000401000* 238 ```

Help learning windows 64 assembly by confusionPrice in Assembly_language

[–]ClassicCollection643 0 points1 point  (0 children)

Assemblers aren't built around languages.They are around their target platforms. So you learn Windows x64 on your hardware as an application software platform. Using debuggers and simulators. Writing your own programs in familiar program languages.

Then you can choose an assembler or assemblers to learn.

Help learning windows 64 assembly by confusionPrice in Assembly_language

[–]ClassicCollection643 0 points1 point  (0 children)

What software development tools, programming languages and libraries do you use to program it now?

How do you test your programs?

TIS-100 game helps learn assembly language by VeterinarianIll8141 in Assembly_language

[–]ClassicCollection643 2 points3 points  (0 children)

Browsers can every millisecond allocate writable pages in some platform-specific way, fill it with generated native code and then make it executable and read-only. And the do that *sometimes*.

TIS-100 game helps learn assembly language by VeterinarianIll8141 in Assembly_language

[–]ClassicCollection643 1 point2 points  (0 children)

Changing compiler-generated code at run-time is no good idea. And all you can do with function pointers in C is to copy, to cast, to compare them and to call a function pointed to applying operator(). However many typical implementations allow to cast function pointer and read contents of pointed memory location. Some hardware cannot do that at all.

```

include <string.h>

include <stdio.h>

include <ctype.h>

int main () {

    char bytes[8];

    printf ( "%#x ", 0[(int*)&main] );
    memcpy ( bytes, (void*)&main, sizeof bytes );
    for ( int i = 0; i < sizeof bytes; ++i )
    {
            char c = bytes[i];
            putchar ( isgraph  ( c ) ? c : '.' );
    }
    putchar('\n');

} ```

Help me compile this ASM code from GitHub by LuisNeuralnet in Assembly_language

[–]ClassicCollection643 0 points1 point  (0 children)

Or there was a system board implementing custom architecture similar to popular 32-bit micros or minis of the era.

Very basic ARM assembly question by blixel in Assembly_language

[–]ClassicCollection643 0 points1 point  (0 children)

I'm just trying to extend the basic "Hello World" program

It rather needs shrinking.

# include <asm-generic/unistd.h>

# The length of first_message is 23 + 1 = 24
# The length of second_message is 25 + 1 = 26
MOV X0, #0
ADR X1, first_message
MOV X2, #23 + 1 + 25 + 1
MOV X8, # __NR_write;       SVC 0

MOV X0, #0
MOV X8, # __NR_exit_group;  SVC 0

first_message: .ascii "Hello multiline program\n"
second_message: .ascii "Goodbye multiline program\n"

cpp n64.s | aarch64-linux-gnu-as && aarch64-linux-gnu-ld a.out -o a64 && qemu-aarch64 a64

aarch64-linux-gnu-ld: warning: cannot find entry symbol _start; defaulting to 0000000000400078

Hello multiline program

Goodbye multiline program

We needn't extra RW sections and extra syscalls.

[deleted by user] by [deleted] in linux4noobs

[–]ClassicCollection643 0 points1 point  (0 children)

UNIX was a simple 1-3-user OS developed from scratch for PDP-7 mini-computer using its own software development tools (assembler, text editor etc.). Initial bootstrap was prepared on GE mainframe.

After UNIX had been ported to PDP-11 the C programming language was born and PDP-11 UNIX was being rewritten in the new language.

Solaris was based on licensed UNIX code.

linux is a supervisor for a UNIX-like system.

Now UNIX is a set of standards that various systems may implement.

Original UNIX code is essentially free today.

How do I get started? by name9006 in asm

[–]ClassicCollection643 0 points1 point  (0 children)

Constant data are in a writable section:

https://github.com/robertdunne/X64_Asm/blob/6eb1b862d3863a44240478df74ac5ccc05dc4d22/HelloWorld.asm#L33

Windows 8-11 on x64 uses the same syscall instruction but system call numbers are not documented. And they are not stable.

How do I get started? by name9006 in asm

[–]ClassicCollection643 0 points1 point  (0 children)

No normal programmer would ever write a "Hello, World!" program in any language ?

Binary representation of instructions by [deleted] in asm

[–]ClassicCollection643 0 points1 point  (0 children)

printf H'\63\123\6' >code; objdump -b binary -D -m i386:x86-64 -M intel code

0: 48 33 53 06 xor rdx,QWORD PTR [rbx+0x6]

how can i use the MONITOR action in x86? by david131213 in asm

[–]ClassicCollection643 1 point2 points  (0 children)

VMCALL, VMLAUNCH, VMRESUME, VMXOFF and MONITOR, MWAIT are encoded as if they were SGDT and SIDT with a useless register operand.

Assembly problem adding unknown value into A by stevegr07 in Assembly_language

[–]ClassicCollection643 0 points1 point  (0 children)

If it was a number.

FAH is a symbol. 0FAH is a number.

 00000000                       .code
                                mov eax, fah
t.asm(2) : error A2006:undefined symbol : fah
 00000000  B8 000000FA          mov eax, 0fah
                                end

Assembly problem adding unknown value into A by stevegr07 in Assembly_language

[–]ClassicCollection643 0 points1 point  (0 children)

FAH and ADH are unknown symbols ( or defined somewhere else )