Questions tagged [16-bit]

Referring to computer architecture with addresses and other data units 16 bits wide.

In computer architecture, 16-bit integers, memory addresses, or other data units are those that are at most 16 bits (2 octets) wide. Also, 16-bit CPU and ALU architectures are those that are based on registers, address buses, or data buses of that size.

414 questions
6
votes
3 answers

80x86 16-bit asm: lea cx, [cx*8+cx] causes error on NASM (compiling .com file)

The error NASM gives (despite my working OS) is "invalid effective address". Now I've seen many examples of how to use LEA and I think I got it right but yet my NASM dislikes it. I tried lea cx, [cx+9] and it worked; lea cx, [bx+cx] didn't. Now if I…
larz
  • 61
  • 2
6
votes
2 answers

Importance of page count and last page size in an MZ (DOS, 16 bit) .EXE header

I am trying to learn how to create Dos .EXE files using assembly (NASM), constructing the header by hand and assembling the file as binary. I have a problem with the page options (both the total number of pages and the byte count at the final page).…
padawan
  • 109
  • 8
5
votes
3 answers

Python and 16-bit PGM

I have 16-bit PGM images that I am trying to read in Python. It seems (?) like PIL does not support this format? import Image im = Image.open('test.pgm') im.show() Shows roughly the image, but it isn't right. There are dark bands throughout and img…
mankoff
  • 2,225
  • 6
  • 25
  • 42
5
votes
1 answer

16 bit C code for real mode kernel

I don't know how to compile my C kernel for 16 bit real mode. I have tried a variety of compilers with no luck. My bootloader simply loads raw sectors from the floppy (my kernel lives right after the first sector on the disk) to the physical memory…
TheFuzz
  • 2,607
  • 6
  • 29
  • 48
5
votes
1 answer

Arbitrary Precision Arithmetic (Bignum) for 16-bit processor

I'm developing an application for a 16-bit embedded device (80251 microcontroller), and I need arbitrary precision arithmetic. Does anyone know of a library that works for the 8051 or 80251? GMP doesn't explicitly support the 8051, and I'm wary of…
Eric
  • 51
  • 1
5
votes
4 answers

Bit level operations, get a bit from a short value

I'm trying to get the following result 00000000000000101 from this input 5. This my code and it doesn't make sense: public static int get16Bits(int x) { System.out.println((x & 0xffff) - ((x & 0x8000) << 1)); return (x & 0xffff)…
user7664681
5
votes
1 answer

What does ASSUME mean in assembler?

Everywhere it is explained as a thing which binds/associates registers with segments, but I want to understand what is bound exactly.
5
votes
6 answers

Problem with writing a 16bit raw PCM file

As a small experimental music piece I am attempting to program a song in standard C. The code outputs a raw PCM file which can be imported into Audacity. At the moment everything works as expected, but I'm encountering problems when trying to write…
blkrbt
  • 51
  • 1
  • 2
5
votes
3 answers

Masking a 16-bit value with 0xFFFF

I am following a guide on Gameboy emulation and, in a snippet of code I saw the following: while(true) { var op = MMU.rb(Z80._r.pc++); // Fetch instruction Z80._map[op](); // Dispatch Z80._r.pc &= 65535; // Mask PC…
Nubcake
  • 449
  • 1
  • 8
  • 21
5
votes
2 answers

MOV BX,[SI] - ASM question

I'm studying ASM 8086 theoretically on highschool. And when I do this: MOV BX,[SI] is SI+1 going to BH or BL? Thank you :-)
Tal
  • 303
  • 1
  • 6
  • 11
5
votes
1 answer

Can't clear entire screen in 16-bit real mode Assembly

I'm trying to clear the screen in my simple 16-bit real mode operating system. Below is the code: clearScreen: pusha mov ah, 0x7 mov al, 0 int 0x10 popa ret I read that setting al to 0 and calling the scroll screen…
icedvariables
  • 99
  • 1
  • 9
5
votes
2 answers

How can I save/load a 16 bit image in .net x64?

Before, when I was using win32, I used FreeImage in order to load and save bitmaps of bit depth greater than 8 bits. That's every image I work with, since I'm doing medical imaging, and before anyone says anything, yes, me and my customers have…
mmr
  • 14,781
  • 29
  • 95
  • 145
5
votes
1 answer

Convert Float32Array to 16 bit float Array Buffer JavaScript

I'm getting PCM audio samples in Float32Arrays. But my application can only support data with a 16 bit length so I need to convert. I'm not sure how to do this since there is no typed array for a Float16Array and I've never worked with data on the…
Conor Patrick
  • 2,879
  • 5
  • 22
  • 33
5
votes
2 answers

Linux x86 bootloader

I am trying to build a simple x86 Linux bootloader in nasm. The Linux bzImage is stored on disk partition sda1 starting from the first sector. I read the real mode code from the bzImage (15 sectors) into memory starting from 0x7E00. However when i…
Druesukker
  • 249
  • 3
  • 10
5
votes
2 answers

Shifting the Sign extended constant in MIPS

Why do we shift by 2 the sign extended 16bit constant in branching instruction in MIPS? I am confused with this idea. What good does this shifting brings to the sign extended 16 bit constant. Here is the picture: Regards
Alfred
  • 1,543
  • 7
  • 33
  • 45
1 2
3
27 28