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
0
votes
1 answer

TASM 16bit segment not supported

TITLE EXOR .model small .stack 100h .data iamge db 'exor.bmp',0 .code mov dx,[bp+4] MOV AX,3d00h int 21h end I'm trying to open a bmp file using assembly but this what happends when I tasm my asm file can you help me why this error occurs? I…
PNC
  • 357
  • 1
  • 5
  • 19
0
votes
1 answer

16b Assembly - creating file with custom filename

I am working on a program in 16b assembly that simply creates a file with a filename that I type myself in runtime and then closes it. The problem is - the file isn't created. Here is my code: org 100h mov ah, 9 mov dx, prompt int 21h mov ah,…
Tomek
  • 147
  • 1
  • 1
  • 11
0
votes
1 answer

Efficient way to get the absolulte difference of two 16 bit signed integers on atmel AVR 8bit gcc?

I am getting 16 bit signed integers from the I2C bus and store them in a local int16 variable. The sensor is a MEMS gyroscope and it regularly spikes high or low data values, it seems to be a general problem with many MEMS gyroscopes. So normal…
John
  • 7,507
  • 3
  • 52
  • 52
0
votes
1 answer

using ax instead of dx with interrupt 21

In the following code data segment ; add your data here! num db 0,0,0,0 sum db 0 str db "Sum is : $" ends stack segment dw 128 dup(0) ends code segment start: ; set segment registers: mov ax, data mov ds, ax …
uchar
  • 2,552
  • 4
  • 29
  • 50
0
votes
1 answer

Convert 14-bit image to 16-bit TIFF using C#

I have a buffer with 14-bit image (640 x 512). I need save this image as 16-bit TIFF. So, each pixel takes 2 bytes, and I can trasform into grayscale (8 bit) like this: (buffer[index] | buffer[index + 1] << 8) & 0x3FFF (index is number of pixel for…
Alexey
  • 35
  • 1
  • 10
0
votes
4 answers

ascii string to sequence of 16-bit values

I'm Python newbie and would like to convert ASCII string into a series of 16-bit values that would put ascii codes of two consecutive characters into MSB and LSB byte of 16 bit value and repeat this for whole string... I've searched for similar…
user2152780
  • 53
  • 2
  • 6
0
votes
0 answers

Unexpected output from boot sector program

I'm teaching myself assembly (NASM) through 16-bit boot loader programming, and I've come across a problem. I wrote a program that uses a function print to display "Hello,World!" to the screen, but I only get 'U' as my output. Here is the…
yossarian
  • 1,537
  • 14
  • 21
0
votes
1 answer

How to compare strings in assembly?

I've looked at How to compare two strings assembly and I'm am trying to compare character by character until a character doesn't match and I can't seem to get my code to function how I want it to. I'm making a simple shell and I'm starting with the…
icedvariables
  • 99
  • 1
  • 9
0
votes
1 answer

How to temporarily store values in a row in assembly?

I'm making a 16-bit real mode operating system and I want to pass commands that the user types in. I can do input but I'm not sure how to store the resulting string so that it can later be parsed. Is there a better way than just putting each…
icedvariables
  • 99
  • 1
  • 9
0
votes
1 answer

parsing a 16 bit RGBA png in javascript

I've extracted the raw pixels from a 16 bit RGBA png and am trying to separate out the colour and alpha into 2 separate TypedArray's. For 8 bit RGBA this works, var pixels = myRawPixels, // a Uint32Array len = pixels.length, colorData = new…
james
  • 4,150
  • 2
  • 30
  • 36
0
votes
1 answer

Division of double word in MASM

HDIVIDEND DW 1234H LDIVIDEND DW 5678H DIVISOR DW 1234H MOV AX,LDIVIDEND MOV DX,HDIVIDEND DIV DIVISOR I am getting an "Illeagal instruction" on running a masm code at the instruction DIV DIVISOR Where HDIVIDEND is the higher order bytes of…
user3041058
  • 1,520
  • 2
  • 12
  • 16
0
votes
1 answer

How to print text in color with interrupts?

This is my code it print in white color which is the default one. I know how to print in color without interrupts, but I don't want to do that. I want to print it in any other color using interrupts.How can I do that?? Any Idea? Thanks in advance I…
Taimour
  • 459
  • 5
  • 21
0
votes
1 answer

Decimal value from bit group in word math explanation

11111 111111 11111 > 16 bit R G B how can I get the R/G/B values? R = x/2048 (2048 are the 6+5 G+B 11 bit) G = x-R*2048/32 (32 are the B ) is there a simple explanation of this? why should the decimal value be divided by others bit to…
summer
  • 213
  • 3
  • 12
0
votes
3 answers

How do we declare multi-bit registers in verilog?

In the declaration of a register, the sample code shows this: reg[15:0] regfile[0:15]; I don't understand why the [0:15] is inverted after the variable name. reg[15:0] declares a 16 bit register but why is it the other way around with the variable…
user2624376
0
votes
1 answer

Applying 16 bit colour on AS3 Graphics API

I need to write a function that draws pixels using 16 bit colour values. I am currently using following code to draw each pixels. var pixel:Shape = new Shape(); pixel.graphics.beginFill(//16bit colour value); pixel.graphics.drawRect (xVal, yVal,…
Jason
  • 1,298
  • 1
  • 16
  • 27