‘mystring + 1’ is the address of the second byte of the string.
mov al, mystring + 1
stores (the least significant byte of) that address in al. To indicate that you don’t want to store the address but the byte located at that address, write this:
mov al, [mystring + 1]
To declare a four-bytes integer equal to say, 42, use:
myint dd 42
Related Contents:
- How do I print an integer in Assembly Level Programming without printf from the c library?
- Boot loader doesn’t jump to kernel code
- NASM Assembly convert input to integer?
- How does $ work in NASM, exactly?
- NASM x86 16-bit addressing modes [duplicate]
- Basic use of immediates vs. square brackets in YASM/NASM x86 assembly
- How to load a single byte from address in assembly
- In NASM labels next to each other in memory are printing both strings instead of first one
- Why isn’t my root directory being loaded? (FAT12)
- How to generate plain binaries like nasm -f bin with the GNU GAS assembler?
- Why NASM on Linux changes registers in x86_64 assembly
- MOV src, dest (or) MOV dest, src?
- How to push a 64bit int in NASM?
- problem in understanding mul & imul instructions of Assembly language
- x86, difference between BYTE and BYTE PTR
- What do the brackets mean in NASM syntax for x86 asm?
- Segmentation fault when using DB (define byte) inside a function
- How to force NASM to encode [1 + rax*2] as disp32 + index*2 instead of disp8 + base + index?
- Assembly difference between [var], and var
- What are the sizes of tword, oword and yword operands?
- NASM Error Parsing, Instruction Expected
- Assembly with %include at the top – Printing Outputs Unexpected Result: just an ” S”
- Why do x86-64 instructions on 32-bit registers zero the upper part of the full 64-bit register?
- Why doesn’t GCC use partial registers?
- How exactly do partial registers on Haswell/Skylake perform? Writing AL seems to have a false dependency on RAX, and AH is inconsistent
- glibc scanf Segmentation faults when called from a function that doesn’t align RSP
- Custom bootloader booted via USB drive produces incorrect output on some computers
- Why in x86-64 the virtual address are 4 bits shorter than physical (48 bits vs. 52 long)?
- A couple of questions about [base + index*scale + disp] and AT&T disp(base, index, scale)
- `testl` eax against eax?
- How does MIPS I handle branching on the previous ALU instruction without stalling?
- Nasm segmentation fault on RET in _start
- When and why do we sign extend and use cdq with mul/div?
- Printing floating point numbers from x86-64 seems to require %rbp to be saved
- MOVZX missing 32 bit register to 64 bit register
- Why can’t I move directly a byte to a 64 bit register?
- How to seed to generate random numbers?
- Why data and stack segments are executable?
- How to tell the length of an x86 instruction?
- x86 XOR opcode differences
- What does the dollar sign ($) mean in x86 assembly when calculating string lengths like “$ – label”? [duplicate]
- Writing a putchar in Assembly for x86_64 with 64 bit Linux?
- 8086 random number generator (not just using the system time)?
- Assembly segmentation fault after making a system call, at the end of my code
- Random number in emu8086 without using DOS/BIOS calls?
- How to do less than or equal in Assembly Language(MIPS)?
- Understanding %rip register in intel assembly
- Why are RISC-V S-B and U-J instruction types encoded in this way?
- Shadow space example
- Add 2 numbers and print the result using Assembly x86