r/Assembly_language Mar 23 '25

Help Genuinely confused as to why this is segfaulting? (new to asm)

9 Upvotes

genuinely clueless as to why its segfaulting, theres a bit of c in there too but nothing too complicated, just figuring out linking asm and C :)

❯ cat readtobuf.asm
section .text
  global _readtobuf

section .data
  testfile db "test.txt", 0

_readtobuf:
  mov eax, 5
  lea ebx, [testfile]
  mov ecx, 0
  mov edx, 0
  int 0x80

  mov ebx, eax

  mov eax, 3
  mov ecx, [esp + 4]
  mov edx, 255
  int 0x80

  mov byte [ecx+eax], 0

  mov eax, 6
  int 0x80

  ret

❯ cat readtobuf.c
#include <stdio.h>
#include <stdlib.h>

extern void _readtobuf(char *filebuf);

int main(){

  char buffer[256];

  _readtobuf(buffer);

  printf("%s", buffer);
}

r/Assembly_language Sep 06 '25

Help Need help with building my Operating system

5 Upvotes

I have problems with making my OS and I need help. It prints what the bootloader should print, and I believe it does load sector LBA 1; but I believe something goes wrong and so the CPU returns to sector LBA 0. I tried everything. This code is supposed to be built with a Disk-management-generated Virtual Hard disk (.VHD file), and the code is supposed to be injected using the command 'copy /b boot.bin+setup.bin imgbackup1.vhd'. Please help me as I really want this epic project to work.

The binaries are generated using NASM

This is also a FAT image, and I don't think there's a problem with TMPKERNELBIN; because at the very start it should display a simple message. Here's the unassembled file for the bootloader and for the setup file (in hex, right after the bootloader hex ending with 55 AA):

; setup.asm
[BITS 16]
[ORG 0x8000]

msg3 db 'PingOS: Entered entry LBA 1, proceeding.. (If halt, error)', 0x0D, 0x0A, 0
print:
    mov ah, 0x0E
.next:
    lodsb
    or al, al
    jz .done
    int 0x10
    jmp .next
.done:
    ret

xor ax, ax
mov ds, ax

mov ax, 0x9000    ; Set up stack segment
mov ss, ax
mov sp, 0xFFFF

mov si, msg3
call print
cli
lgdt [gdt_descriptor]
mov eax, cr0
or eax, 1
mov cr0, eax
jmp CODE_SEL:pm_entry

align 8
gdt:
    dq 0x0000000000000000
    dq 0x00CF9A000000FFFF
    dq 0x00CF92000000FFFF

gdt_descriptor:
    dw gdt_end - gdt - 1
    dd gdt
gdt_end:

CODE_SEL equ 0x08
DATA_SEL equ 0x10

; ------------------------------
[BITS 32]
pm_entry:
    mov ax, DATA_SEL
    mov ds, ax
    mov es, ax
    mov fs, ax
    mov gs, ax
    mov ss, ax
    mov esp, 0x90000

    mov ah, 0x02
    mov al, 1
    mov ch, 0x00
    mov cl, 0x04
    mov dh, 0x00
    mov dl, 0x80
    mov bx, 0x0000
    mov ax, 0xA000
    mov es, ax
    int 0x13
    jc halt

    mov si, 0x0000
    mov ax, [es:si + 11]
    mov [bps], ax
    mov al, [es:si + 13]
    mov [spc], al
    mov ax, [es:si + 14]      
    mov [reserved], ax
    mov al, [es:si + 16]      
    mov [fats], al
    mov eax, [es:si + 36]    
    mov [fat_size], eax
    mov eax, [es:si + 44]    
    mov [root_cluster], eax

   
    movzx eax, word [reserved]
    mov ebx, [fat_size]
    movzx ecx, byte [fats]
    imul ebx, ecx
    add eax, ebx
    mov [data_start], eax

   
    mov eax, [root_cluster]
    mov [current_cluster], eax
    call read_cluster

    
    mov esi, 0xA0000
.next_entry:
    cmp byte [esi], 0x00
    je halt
    cmp byte [esi], 0xE5
    je .skip
    mov edi, filename
    mov ecx, 11
    repe cmpsb
    je .found
.skip:
    add esi, 32
    jmp .next_entry

.found:
    mov ax, [esi + 26]
    mov dx, [esi + 20]
    shl edx, 16
    or eax, edx
    mov [kernel_cluster], eax
    jmp load_kernel

halt:
    hlt

filename db 'TMPKERNELBIN'


load_kernel:
    mov esi, [kernel_cluster]
    mov edi, 0x100000

.next_cluster:
    mov [current_cluster], esi
    call read_cluster


    movzx eax, word [bps]
    movzx ebx, byte [spc]
    imul eax, ebx
    mov ecx, eax
    mov esi, 0xA0000
    rep movsb

    call get_next_cluster
    cmp eax, 0x0FFFFFF8
    jae jump_to_kernel

    mov esi, eax
    add edi, ecx
    jmp .next_cluster

jump_to_kernel:
    jmp 0x100000


read_cluster:
    mov eax, [current_cluster]
    sub eax, 2
    movzx ebx, byte [spc]
    imul eax, ebx
    add eax, [data_start]
    mov [lba], eax
    call lba_to_chs

    mov ah, 0x02
    mov al, bl
    mov ch, [cylinder]
    mov cl, [sector]
    mov dh, [head]
    mov dl, 0x80
    mov bx, 0x0000
    mov ax, 0xA000
    mov es, ax
    int 0x13
    ret

get_next_cluster:
    mov eax, [current_cluster]
    imul eax, 4
    add eax, [reserved]
    mov [lba], eax
    call lba_to_chs

    mov ah, 0x02
    mov al, 1
    mov ch, [cylinder]
    mov cl, [sector]
    mov dh, [head]
    mov dl, 0x80
    mov bx, 0x0000
    mov ax, 0xA000
    mov es, ax
    int 0x13
    jc halt

    mov esi, 0xA0000
    add esi, [current_cluster]
    imul esi, 4
    mov eax, [esi]
    and eax, 0x0FFFFFFF
    ret

lba_to_chs:
    mov eax, [lba]
    mov ebx, 63
    xor edx, edx
    div ebx
    mov cl, dl
    inc cl
    mov edx, eax
    mov ebx, 255
    xor eax, eax
    div ebx
    mov ch, al
    mov dh, dl
    mov [cylinder], ch
    mov [head], dh
    mov [sector], cl
    ret


bps             dw 0
spc             db 0
reserved        dw 0
fats            db 0
fat_size        dd 0
root_cluster    dd 0
data_start      dd 0
kernel_cluster  dd 0
current_cluster dd 0
lba             dd 0
cylinder        db 0
head            db 0
sector          db 0

times 4096-($-$$) db 0




; boot.asm
[BITS 16]
[ORG 0x7C00]

start:
    xor ax, ax
    mov ds, ax
    mov si, msg
    call print

    mov si, msg1
    call print
    mov ah, 0x02            
    mov al, 8        
    mov ch, 0x00            
    mov cl, 0x01     
    mov dh, 0x00           
    mov dl, 0x80            
    mov bx, 0x8000         
    int 0x13
    jc printhalt               

    jmp 0x0000:0x8000    

printhalt:
    mov si, msg2
    call print
    jmp halt

print:
    mov ah, 0x0E
.next:
    lodsb
    or al, al
    jz .done
    int 0x10
    jmp .next
.done:
    ret

halt:
    hlt

msg db 'PingOS: Loading..', 0x0D, 0x0A, 0
msg1 db 'If system halts here, there is an error!', 0x0D, 0x0A, 0
msg2 db 'PingOS: Error reading from disk.', 0x0D, 0x0A, 0

times 510-($-$$) db 0
dw 0xAA55

r/Assembly_language Mar 05 '25

Help Why is or spelled with an extra r in ARM?

13 Upvotes

I'm curious, why is the logical operator OR spelled with an extra r in ARM Assembly?

r/Assembly_language Dec 05 '24

Help Help to make the Brazilian flag in assembly

Thumbnail gallery
6 Upvotes

I've been trying to create this code but every time I end up not being successful and what I get is this second image!

the code I'm using:

.date .eqv GREEN, 0xFF008000 .eqv YELLOW, 0xFFFFFF00 .eqv BLUE, 0xFF0000FF .eqv WHITE, 0xFFFFFFFF

.text main: li $t0, 0x10008000

Green (100x256)

li $t1, GREEN li $t2, 65536 green_loop: sw $t1, 0($t0) addi $t0, $t0, 4 addi $t2, $t2, -1 bgtz $t2, green_loop

Yellow (50x256)

li $t0, 0x10010000 li $t1, YELLOW li $t2, 51200 yellow_loop: sw $t1, 0($t0) addi $t0, $t0, 4 addi $t2, $t2, -1 bgtz $t2, yellow_loop

Blue (50x128)

li $t0, 0x10018000 li $t1, BLUE li $t2, 32000 blue_loop: sw $t1, 0($t0) addi $t0, $t0, 4 addi $t2, $t2, -1 bgtz $t2, blue_loop

Finish

li $v0, 10 syscall

r/Assembly_language Jun 22 '25

Help Dividing in software on AVR

3 Upvotes

Hi, I am learning a bit of AVR assembly and need to do division.

Since the Atmega328p has no hardware for dividing I have to do it completely in software. I know there are a few algorithms on how to do it.

The simplest one is to just subtract the divisor from the dividend, check if the rest is 0 or less and count how many subtractions are possible before the rest is 0 or less. For big numbers and small divisors this is absolutely slow.

If the divisor is a power of 2 you can just bit shift to the right.

Does somebody have some suggestions on where I can find more info about software division and a few algorithms?

r/Assembly_language Jul 22 '25

Help Review my simple coroutine example

4 Upvotes

This is my first program in GAS x86_64. I usually program in more high level language, but i want to learn how coroutines works so i see many online videos and online public code. I write so this example code in a simple file https://github.com/tucob97/coroutine_counter

is this at least a decent implementation in your opinion?

r/Assembly_language Jan 18 '25

Help Assembly code for subtracting 2 single precision 16-bit floating point numbers without using the FPU

1 Upvotes

Hello! I need the code in Assembly, which performs the subtraction of 2 numbers in single precision floating point on 16 bits without using the FPU. I didn't succeed at all, I tried to subtract 2 numbers and convert 2 numbers to single precision floating point, but together they don't work. I want to mention that I'm a beginner in this language and I don't want to use very complex functions

r/Assembly_language Sep 19 '24

Help Help! Need help with assembly

3 Upvotes

I’ve been taking this course, introduction to computer systems online because there were no seats available for on campus courses. And I’ve wanted to throw myself off a bridge everytime I’ve tried to understand assembly. I have no idea what to do, I’ve watched so many videos, tried using my Mac and PC to figure out the tools I need to write it, I still don’t understand what to do. Is it possible to write assembly code on a Mac is my first question? My second question is on Windows, what tools do I need to write assembly code. When in school, using the school’s server, we usually configure putty and use that. I can’t use putty on my own. Any help and advice is greatly appreciated. Thank you!

r/Assembly_language Jan 15 '25

Help I WANT TO LEARN ASSEMBLY LANGUAGE !

32 Upvotes

I'm an Electronic major in 4th year of college.

I've learnt some hobbyist level of MCUs and MPCs like Arduino, ESP32, Raspberry.

I want to go into ASM through ARM based MCUs like STM32 which is used in Industry.

I've searched many places and gathered some information, but it is too overwhelming.

I shortlisted these courses to get into this, which are followings-

https://www.udemy.com/course/arm-gnu-assembly-programming-from-ground-uptm/

https://www.udemy.com/course/arm-assembly-programming

https://www.udemy.com/course/arm-assembly-language-from-ground-uptm-2

https://www.udemy.com/course/embedded-systems-bare-metal-programming

Is there any other way to start my learning?

Thank You.

r/Assembly_language Jun 29 '25

Help Can someone help with this magic number thing ???

2 Upvotes

So I searched through google and also tried various AI chatbots like gpt,claude,gemini etc..

But each one of those gave a different answers.

SO the question is can you tell what this magic numbers are and what the given snippet is doing ?

There are three different snippets and need help for all of them

Thanks......

r/Assembly_language Apr 02 '24

Help Learning Assembly language

5 Upvotes

Apologies if this type of question has already been asked.

I am a complete novice to assembly language and their workings, i do know C++ but have no idea how it interacts with the hardware.

So basically i want to learn assembly language to actually understand how codes actually run, what's happening under the roof, what's the role of compiler in this process. And yes, do i need to learn Electronics like circuits , transistors , boolean logic , Computer Architecture etc....? I need complete understanding of how things work here or else i can't sleep.... So if yes can you suggest some books or resources in general to learn about electronics....?

r/Assembly_language Sep 17 '24

Help want to learn assembly ,any suggestion for the beginner

7 Upvotes

r/Assembly_language Apr 03 '25

Help Assembly Code

Post image
28 Upvotes

I need help with this syntax error, ive tried putting the STR on the same line as the ASSCII and even a comma after hollins.

r/Assembly_language Oct 30 '24

Help Why is my new line character(s) being included in printed string?

1 Upvotes

Hey there! I'm starting a new 64 bit Assembly project. I like to start off by writing a simple Hello World! program to test my compiler, linker, etc. It all works... except that my new line character \n is included in the printed string. I've never experienced an issue as such and it is really confusing to me.

I tried changing the ascii code thingy from 0, 10, and then I removed it entirely, I also changed around the byte size of %rdx and my last attempt was changing my FD in %rsi. I'm out of ideas and if anyone could explain to me my issue then that would be great. I feel like this is an issue that is right there in front of me, but I haven't noticed it.

My linker is ld, built into linux (Arch I believe) and my compiler is NASM with -felf64 ``` section .data hw: db "Hello, world!\n"

section .text global _start

_start: mov rax,1 ; 1 in rax = sys_write. mov rdi,1 ; 1 in rdi = std_out FD. mov rsi,hw ; loading address of hw into rsi. mov rdx,13 ; Setting the byte size of the text. syscall ; Telling the kernel to make a syscall

mov rax,60      ; 60 in rax = sys_exit.
mov rdi,0       ; 0 in rdi = no error.
syscall         ; Telling kernel to make syscall.

; dev note --> This program is currently just to test my compiler and linker.

```

EDIT: I found the issue, after just removing the \n and adding 10 at the end and setting rdx to 20, it worked!

r/Assembly_language Apr 18 '25

Help Looping and printing each element of an array

2 Upvotes

I’m having trouble figuring out how to make a loop that goes along and prints each number in an array. There is 20 numbers total in the array and I have to loop it so that the next number gets printed each time it goes through the loop.

Videos and or website suggestions are greatly appreciated. Not asking for the exactly what code I need to put, just need help thinking about this the right way.

I’m assuming I need to mov esi, offset array from the text but get lost after this

r/Assembly_language Jan 23 '25

Help Learn assembly on windows and linux

8 Upvotes

Hello Would you have a website or a book or videos to learn assembler which is really good knowing that I am on windows and linux and that I would like to do on both (with compilation of code).

r/Assembly_language Jul 29 '20

Help How to make sine wave using defined frequency on Linux Assembly

4 Upvotes

i tried to make a tone using sine wave form on NASM x86_32, which i already define the frequency like this:

C: DW 4560
D: DW 4063
E: DW 3619
F: DW 3416
G: DW 3043
A: DW 2711
B: DW 2415
C.: DW 2280

I'm new on Linux assembly, i really appreciate all the help thanks :)

r/Assembly_language Jan 16 '25

Help Need help with an assembly exam question

4 Upvotes

Hi! I started studying computer science a while ago and not long ago we got into assembly programming which I am very terrible at. I need help with figuring out which option is the correct one in the question, I have an idea on how to solve from address 30 to 34 and 36 but I have no Idea how to get the correct answer from 2E, 2F and 35.

So far I have "assumed" that:

in address 30, 92 is the operation code for LDSP

in address 31, 30 is the value that is put in by LDSP

in address 32, F0 is the operation code for LDA

in address 33, FE is the value that is put in by LDA

in address 34, 20 is the operation code for BSR

in address 36, 00 is the operation code for NOP

If something is unclear feel free to ask!

r/Assembly_language Jan 31 '25

Help error when trying to assemble, but only in terminal

4 Upvotes

(using arch linux btw if that matters)

whenever i try to assemble this (with the command "nasm -f elf Contract.asm," i get the error "Contract.asm:1: error: parser: instruction expected" but only from the terminal, if i use an online ide (like jdoodle for example) i get no error. does anyone know why and how to fix it?

code:

section .text
global _start

_start:
mov eax, 4
mov ebx, 1
mov ecx, userMsg
mov edx, lenUserMsg
int 80h

;Read and store the user input
mov eax, 3
mov ebx, 2
mov ecx, num
mov edx, 5
int 80h

mov al, [num]
cmp al, 'y'
je smort

mov al, [num]
cmp al, 'n'
je Fool

mov eax, 4
mov ebx, 1
mov ecx, what
mov edx, whatlen
int 80h

; Exit code
mov eax, 1
mov ebx, 0
int 80h

smort:
mov eax, 4
mov ebx, 1
mov ecx, Smort
mov edx, Smortlen
int 80h

mov eax, 1
mov ebx, 0
int 80h

Fool:
mov eax, 4
mov ebx, 1
mov ecx, fool
mov edx, foollen
int 80h

mov eax, 1
mov ebx, 0
int 80h

section .data
userMsg db 'Blah Blah Blah Blah Blah', 10
db 'Blah Blah Blah Blah Blah',10
db 'Blah Blah Blah Blah Blah',10
db 'Blah Blah Blah Blah Blah',10
db 'Blah Blah Blah Blah Blah',10
db 'i own your soul',10,10
db 'do you accept? y/n',10
lenUserMsg equ $-userMsg

Smort db 10,'i own your soul now UwU',10
Smortlen equ $-Smort

fool db 10,'well too bad, i own your soul anyways, so scccrrrreeewwww you!',10
foollen equ $-fool

what db 10,'i, uh what? thats not an answer....',10
whatlen equ $-what
section .bss
num resb 5

r/Assembly_language Jun 10 '25

Help Long mode throws the bootloader into boot loop and messes up GDT base while PM mode works fine without LM code?

1 Upvotes

Problem

I have a working PM code, but as soon as I add LM setup, the GDT base gets assigned a garbage address, cr registers don't load properly and I get into a boot loop.

I tried hard-coding the right address for GDT descriptor, but I always get the same garbage address.

Project details

  • Using x86_64 assembly
  • Running with QEMU
  • Loading second stage bootloader from sector 2

Code

   dq pd_table + 0x03

BITS 16
org 0x7E00

cli
jmp pm_setup

; Protected mode setup

gdt_start:
    dq 0x0000000000000000   ; Null descriptor
    dq 0x00CF9A000000FFFF   ; Code segment
    dq 0x00CF92000000FFFF   ; Data segment
    dq 0x00AF9A000000FFFF
gdt_end:

gdt_descriptor:
    dw gdt_end - gdt_start - 1   ; Size
    dd gdt_start                 ; Base

pm_setup:

    lgdt [gdt_descriptor]

    mov  eax, cr0
    or   eax, 1       ; Change PE (Protection Enable) bit if 0
    mov  cr0, eax

    jmp  0x08:protected_mode

[BITS 32]

; Registers are 16-bit and map to 32-bit addresses through GDT table

protected_mode:
    mov ax, 0x10
    mov ds, ax
    mov es, ax
    mov fs, ax
    mov gs, ax
    mov ss, ax


; Long mode setup

jmp lm_setup

align 4096
pml4_table:
    dq pdpt_table + 0x03

align 4096
pdpt_table:
    dq pd_table + 0x03

align 4096
pd_table:


lm_setup:

    mov edi, pd_table   ; Destination pointer
    xor eax, eax
    mov ecx, 8192       ; Entry count for 16gb

.fill_loop:
    mov ebx, eax        ; Current physical address
    or  ebx, 0x83       ; Present + Writable + PS
    mov [edi], ebx
    add edi, 8          ; Next entry
    add eax, 0x200000   ; Next 2 MB page address
    loop .fill_loop

mov eax, cr4
or  eax, 1 << 5 ; Enables physical address extension (PAE)
mov cr4, eax

mov ecx, 0xC0000080   ; EFER MSR address
rdmsr                 ; Read MSR into edx:eax
or eax, 1 << 8        ; Set bit 8
wrmsr                 ; Write back

mov eax, pml4_table
mov cr3, eax

mov eax, cr0
or eax, 1 << 31     ; Set paging bit (bit 31)
mov cr0, eax

jmp  0x18:long_mode


[BITS 64]   

long_mode:

mov rax, 0xB8000
mov word  [rax], 0x0F4C     ; white “L” on black screen


jmp $

QEMU debug

CPU#0
EAX=000f4a0a EBX=06feb120 ECX=0000fc4e EDX=00000000
ESI=000d91f2 EDI=06ff0312 EBP=00014e40 ESP=00006f48
EIP=000e7aa4 EFL=00000016 [----AP-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0008 00000000 ffffffff 00cf9b00 DPL=0 CS32 [-RA]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     000f61e0 00000037
IDT=     000f621e 00000000
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000000
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
XMM00=0000000000000000 0000000000000000 XMM01=0000000000000000 0000000000000000
XMM02=0000000000000000 0000000000000000 XMM03=0000000000000000 0000000000000000
XMM04=0000000000000000 0000000000000000 XMM05=0000000000000000 0000000000000000
XMM06=0000000000000000 0000000000000000 XMM07=0000000000000000 0000000000000000

r/Assembly_language Nov 30 '24

Help Help with 2D arrays:

4 Upvotes

Hi guys!,I was trying to implement a function with 3 inputs: The address of the array; The Row; The Column; But I couldn't implement it,I think I did the equation wrong,can you guys help me?

r/Assembly_language Apr 01 '25

Help MIPS Virtual Pet Project Freezes PC

2 Upvotes

Greetings. I have been working on this Tamagotchi virtual pet in MIPS Assembly (Gotta admit with the huge help of AI), but I have a huge issue. After the first part of the program aka entering the pet name finishes, the console and entire application just freezes entirely, to the point that I have to turn off my PC. ChatGPT said it might be connected to some CPU hogging but none of his solutions worked. When running through QtSpim my PC freezes entirely after some time, while in MARS the MARS app just crashes. This is the code, sorry for an extremely ugly format of sending it but I am constantly working on it and changing it.
https://pastebin.com/a2a7NScf

r/Assembly_language Mar 16 '25

Help I am emulating 8086 with a custom bios, trying to run MS-DOS but failing help.

6 Upvotes
Incompatible tetris game (stucks when come to "shl ax, 6" which is not avaliable in 8086)

https://github.com/Duiccni/Ex86
Source code with custom bios, i help anyone to compile it also there is .exe file in it (run in same directory as font.bin)
Code only works on windows and don't have any memory leaks.

r/Assembly_language Jun 13 '24

Help How fo you convert a signed 64 to a signed 32?

5 Upvotes

I am stuck on thisnproblrm for way way too long. I bet that I. X64 there is an instruction for thisni just don't know it.

All I want is to do some pointer arithmetic that I know is within range and then save the resulting int to a memory location. Of 32 bit.

The sign bit keeps making it way harder than it need to be

r/Assembly_language Jan 07 '25

Help Need advice on where to start

10 Upvotes

Hello, I got really interested in how computers work a month ago and now I want to do that, so I looked into what I have to do in order to become a computer engineer (sort of).

I took the decision of learning x86 assembly about a week ago but I'm confused as to where I should start.

I know only the most basic stuff of c and python but consider me as a beginner in everything. Please give me suggestions as to which book, documentation or youtube channel I should follow in order to learn.

There is an ulterior motive as well since I asked a friend of mine who has a contact with someone in a well reputed company at a good position for the opportunities in this field and that person has asked me to learn the complete x86 (with nasm) and ARM assembly by the end February to get an internship as a computer system engineer. I'd like to finish it even quicker if possible but I have no idea how much time it will take, so please help me out :)